Reset specific localStorage key #642
Unanswered
thewh1teagle
asked this question in
Help
Replies: 0 comments
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.
-
How can I reset local storage item?
say I have the following:
Say I changed it to 10. and I want to reset it to default value passed to the hook. how can I reset it and reflect it in the UI?
eg. can I just do
localStorage.removeItem(...)
I don't want to manually set the initial value but rather just reset it somehow in a way that also the state will update immediately with the initial value.
Beta Was this translation helpful? Give feedback.
All reactions