-
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.
Answered by
kaisiant
Feb 25, 2021
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.
1 reply
-
Solved with this solution:
Solution: https://codesandbox.io/s/sleepy-grass-w64b1?file=/pages/index.js |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
kaisiant
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Solved with this solution:
Solution: https://codesandbox.io/s/sleepy-grass-w64b1?file=/pages/index.js