atomWithStorage isn't initalizing localstorage with the initalValue, instead "null" #2575
Replies: 2 comments
|
Can you please create a fresh reproduction with stackblitz? |
0 replies
|
Very sorry, but it seems the error was from my side 🙏 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
In a file:
Then I'm using this
statein a react component. When it renders, an error pops that thestateis not defined.On checking the LocalStorage of the browser, it seems that the value of the
"key"property is set tonull(instead of theinitialValueI set when creating the atom, i.e,{ ... })All reactions