-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
useStorageState #76
Comments
我理解既然要保存就不应该在 unmount 的时候 clear 掉 storageState, |
不传参数直接调用 |
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
支持把
state
支持化的存储在 localStorage 中,例如暂存用户输入的内容,保存用户的设置。API
第一个参数为 localStorage 的 key ,第二个参数为 state 的默认值。
返回值的类型和
useState
一致。Demo
The text was updated successfully, but these errors were encountered: