Has anybody else managed to get state persistence between sessions, with nextjs and mobx?
I keep running into issues with this. Any help would be appreciated.
Has anybody else managed to get state persistence between sessions, with nextjs and mobx?
I keep running into issues with this. Any help would be appreciated.
You have to save it in localStorage, and initialize state with it :
example :
const [state, setState] = useState(localStorage.getItem(‘state’));