-
What I was doing is to keep the sidebar state in the local storage. Here my code:
layout.tsx
I am able to get the correct state after doing the refresh, the only problem is the UI cannot rerender. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I can't reproduce the issue (or maybe I don't understand it?). I've created a codesandbox (https://codesandbox.io/s/priceless-wood-kp9t6?file=/pages/index.js) but the ui seems to show the persisted state (which I believe, is what you want). |
Beta Was this translation helpful? Give feedback.
-
Solved with this solution:
Solution: https://codesandbox.io/s/sleepy-grass-w64b1?file=/pages/index.js |
Beta Was this translation helpful? Give feedback.
Solved with this solution:
Solution: https://codesandbox.io/s/sleepy-grass-w64b1?file=/pages/index.js