(no title)
joesb | 4 years ago
One day React could change from using Virtual Dom to the Svelte way and most user of library wouldn't notice.
The point of the article is that React remember where to make the modification for you.
joesb | 4 years ago
One day React could change from using Virtual Dom to the Svelte way and most user of library wouldn't notice.
The point of the article is that React remember where to make the modification for you.
kreetx|4 years ago
lukevp|4 years ago
If you say why does react need the whole state, it’s because React is a translation layer between an immediate mode representation and a retained mode system (the DOM). To illustrate this in a basic way, think of a checkbox. It is an entity in the DOM, but it is also retaining state itself (there is a Checked property that persists as long as it is set, so you know it has state). The only way to know if that checkbox is checked or not is to query the DOM to get the checkbox entity, or to “control” the rendering of the component so you can always derive the checked state from somewhere in your code, and force its state to match. React controlled components are a way to express unidirectional state from your code to the UI.
What situation were you in where vdom was the problem? I’d love to see an example. It is likely that vdom was not the performance issue, something was wrong with the implementation and causing a full re-render. Could you link a sandbox?