2 ms·
I think you're muddy on a couple points: - React doesn't require the existing markup to match - it will happily clobber whatever it finds lurking in its contai
by bsimpson 9y ago
I think you're muddy on a couple points:
- React doesn't require the existing markup to match - it will happily clobber whatever it finds lurking in its container. The first render is probably faster if it matches, but it isn't like your page is going to crash if they are out-of-sync.
- The Shadow DOM is a way to encapsulate styles/state in DOM elements - it's what draws the slider thumb in an <input>, and what allows Web Component styles to use simple selectors like "button" without commandeering the all the buttons on the host page. It has nothing to do with React. I think the phrase you're looking for is "virtual DOM".