Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

What is browser memory or virtual memory in React?

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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).

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading