We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
cookie
5.x
useEffect 的定时器中 compareValue->handler() 调用的 handler 是最新的。
compareValue->handler()
使用 useEffect 开启定时器,在定时器中使用外部的compareValue方法,存在闭包问题,导致 compareValue 一直是最开始的,而compareValue中又调用了外部的handler,handler被compareValue闭包了,导致handler中的所有数据都是最开始的状态,不是最新数据。
compareValue
handler
The text was updated successfully, but these errors were encountered:
No branches or pull requests
组件
cookie
版本
5.x
期望的结果
useEffect 的定时器中
compareValue->handler()
调用的 handler 是最新的。实际的结果
使用 useEffect 开启定时器,在定时器中使用外部的
compareValue
方法,存在闭包问题,导致compareValue
一直是最开始的,而compareValue
中又调用了外部的handler
,handler
被compareValue
闭包了,导致handler
中的所有数据都是最开始的状态,不是最新数据。The text was updated successfully, but these errors were encountered: