2 ms·
There's all sorts of separate sources of truth in that system: Data that exists in the server, data that exists in your javascript frontend, data that exists a
by dnautics 6y ago
There's all sorts of separate sources of truth in that system: Data that exists in the server, data that exists in your javascript frontend, data that exists as pixel intensities in the screet. At a high level, the virtual DOM exists to arbitrate the non-simultaneity of updates to all of these moving parts. It lets react model its system as a "single source of truth" with a functional "prop-drilling system". It gives react components gravity to a data source it can consider authoritative (separate from the actual DOM which attracts the browser's own sets of sub-applications) which is also separate from the applications sitting on top of your data in the server, etc. etc. etc.