-
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
[RFC] useStateRealtime #1868
Comments
我想知道这个 RFC 被关闭的理由 |
ahooks官方实现了这个hooks,可以去官网看下。但是官网的hooks在某种情况下,拿不到最新值 |
非常感谢你们的回答 |
我上面提的那个hooks,也能满足吧,获取到最新值。 |
可以的,殊途同归,上述评论只是以 open 的 PR 做举例哈~ |
useStateRealtime
对 useState 进行增强,第三个返回值增加了一个 get 方法,可以在设置 setState 后立即在其他地方获取到这个值。
核心特性
作用说明
代码演示
::: react
:::
API
参数
返回值
备注:类型声明
The text was updated successfully, but these errors were encountered: