-1

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.

dan1st
  • 12,568
  • 8
  • 34
  • 67

1 Answers1

0

You have to save it in localStorage, and initialize state with it :

example :

const [state, setState] = useState(localStorage.getItem(‘state’));