3 ms·
Hmmm, I haven't tried React yet. Yeah, now it operates directly on the DOM, but all functions for DOM manipulation are located in separate class, so maybe we wi
by szdszdszd 11y ago
Hmmm, I haven't tried React yet. Yeah, now it operates directly on the DOM, but all functions for DOM manipulation are located in separate class, so maybe we will try hook them somehow. Looked at React docs really quickly, it seems they have been abstracted away DOM manipulation to prevent unnecessary browser reflow/recalc ops. So, I can't predict now how easily it will be to sync it with React.(we will try to do it)
- lobster_johnson 11y agoActually, the virtual DOM isn't to prevent unnecessary operations, it's to ensure consistency. State transitions cause a render, which builds the virtual DOM (for each component) from scratch, ensuring that the same state always results in the same rendering output. This is different from, say, Backbone, where you create or modify individual DOM elements, and this logic is typically spread out across many functions.
- deleted 11y ago[deleted]