5 ms·
> You can't have a view containing the whole form and just re-render that as someone types. If you did, you'd lose the user current focus on every render. This
by Touche 11y ago
> You can't have a view containing the whole form and just re-render that as someone types. If you did, you'd lose the user current focus on every render. This forces you to manipulate parts of the DOM "by hand", something React abstracts for you.
This is not how most modern view engines work. Somehow the React community has convinced the entire JS world that they invented the idea of "only render what has changed" when that's just not the case.
- bryanlarsen 11y agoYou've got that backwards. Every other framework "only renders what has changed". React re-renders everything.
- Touche 11y agoReread that in the context of the parent's statement. There is a misconception that every other template library blows away parts of the dom on each update and that only React will do something like input.value=newValue, but this is not the case.
- oldmanjay 11y agoI sure don't see where that misconception is the fault of "the React community." In fact, this comment is the first time I've seen that formulated. I'll be honest, I don't read every React-related forum entry on the Internet, so I may have missed someone somewhere spreading such a misconception, but there certainly is no such centrally communicated premise.
- Zer8 11y agoReact only "renders" everything within its shadow DOM. It then applies the results of diffing the previous and current version trying to use the most atomic operation (innerText, add/removeClass, add/removeNode, etc)
- Zer8 11y agoWe're talking about Backbone + templating here, and that is what happens with those libs. Obviously there are other libs / frameworks that can do that, all of them using some sort of shadow DOM.