Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

state changes when changing route useContext next

//If the user refreshes the page the app reset so you will lose any state yes,
//to navigate to different pages without refreshing the page you have to use the 
//Link component from next/link (or react-router-dom if using React), if you want to preserve the user state
//between refreshes you can save it to the localStorage
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #state #changing #route #useContext
ADD COMMENT
Topic
Name
1+1 =