I have been studying react in depth and there’s one thing which I am not understanding and have already spend so many hours on that.
So if we talk about virtual dom, we know:
The virtual DOM (VDOM) is an in-memory representation of Real DOM. The representation of a UI is kept in memory and synced with the “real” DOM
But can anyone please tell me what’s memory here ?? Is it browser memory or system memory ? and if it’s browser memory then where is it stored? I still didn’t get this answer anywhere!
Also if we talk about webpack-dev-server, it serves content virtually and it doesn’t writes to disk. But from where it servers ? where the content is stored ?
>Solution :
The answer for both React and webpack-dev-server is that they store the data in your RAM memory.
In the case of React, there’s code that’s synchronizing data from there to the DOM through the usage of DOM API.
Note that in case of webpack-dev-server, you can also force it to write to the disk but generally that’s avoided (disk wear, a bit slower).