DEV Community

Discussion on: Props Drilling In React?

Collapse
 
xinyan_yu profile image
Chinita Y

Thanks for the information! I would like to ask if the context could survive page refresh? Since in my project I use stores to store all global variables and they will be reset after page refresh.
Thanks in advance :)

Collapse
 
dawx profile image
Dawx

Context doesn't save data on refresh, to achieve that you can save data to local storage, cookies, or session. If you are using redux for state management, there is redux-persist package that will do the same.

Collapse
 
akramnarejo profile image
Akram Narejo

context doesn't have, what you are asking.