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