-
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
【bug】createUseStorageState连续多次setState(pre => xx)的表现和 useState 的不一致 #2389
Comments
Damon0820
changed the title
useStorage/Cookie的多次setState(pre => xx)表现和 useState 的不一致
【bug】useStorage/Cookie的多次setState(pre => xx)表现和 useState 的不一致
Dec 5, 2023
Damon0820
changed the title
【bug】useStorage/Cookie的多次setState(pre => xx)表现和 useState 的不一致
【bug】createUseStorageState连续多次setState(pre => xx)的表现和 useState 的不一致
Dec 5, 2023
18 tasks
18 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
问题
连续多次调用 createUseStorageState 的 setState(pre => xx),期望 pre 是上次的值,这个期望和 useState 的 setState 表现是一致的。目前通过下面示例发现,连续多次调用 createUseStorageState 的 setState(pre => xx),pre的值都是当前重新渲染时的快照,而非上次 setState 的值。demo链接:https://stackblitz.com/edit/stackblitz-starters-pwoao8?file=src%2FApp.tsx
The text was updated successfully, but these errors were encountered: