-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(useStorageState): default value is not stored #2064
Conversation
|
4d36599
to
eb57a08
Compare
@AmirabbasJ please sign the CLA |
@crazylxr ready to merge |
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
💡 Background and solution
The issue was that the current implementation of
useLocalStorageState
does not save the default state to the storage (being localStorage on the web).To fix that I just added a
setDefaultStoredValue
function which does that, and is only run whengetStoredValue
can't find any persisted data and resorts to the default value.📝 Changelog
☑️ Self Check before Merge