question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Root element is not rendering

See original GitHub issue

Hyperscript’s root element is not rendering allways. Because snabbdom.js line 184 … oldCh = oldVnode.children, ch = vnode.children;…

Problem:

 var vnode = h('div#id.two.classes', [
        h('span', 'This is text')
    ]);
    patch(document.getElementById('container'), vnode);

output as

<div id="container"><span>This is text</span></div>

But may be:

<div id="container"><div id="id" class="two classes"><span>This is text</span></div></div>

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
paldepindcommented, Oct 25, 2015

@avesus

Things specified in first argument are selector

The first argument to h is not a selector. It’s a description of the element including its tag name, its id and it’s static classes.

Is it possible to create true component wrapper to allow snabbdom to behave like React Components?

I certainly think it is possible to build such a thing on top of Snabbdom.

0reactions
avesuscommented, Oct 23, 2015

I absolutely disagree with idea that h('div#myId.myClass', ['This is text']) should become <div id="myId" class="myClass">This is text</div> Things specified in first argument are selector, but I’ve no complete understanding of such selectors at all because of hierarchical JSX Components idea. Is it possible to create true component wrapper to allow snabbdom to behave like React Components?

Read more comments on GitHub >

github_iconTop Results From Across the Web

React component not rendering in root - Stack Overflow
I am trying to display a simple form using react but I get the error "Target container is not a DOM element" despite...
Read more >
ReactDOM.render is no longer supported in React 18
The error "ReactDOM.render is no longer supported in React 18. ... The root has a render() method that can be used to render...
Read more >
ReactDOM – React
Render a React element into the DOM in the supplied container and return a reference to the component (or returns null for stateless...
Read more >
I dont know but any of my element is not rendering on browser
I dont know but any of my element is not rendering on browser (Example) | Treehouse Community.
Read more >
React Render HTML - W3Schools
React renders HTML to the web page by using a function called ReactDOM.render() . ... Note that the element id does not have...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found