useReactive 是否可以跳过 useEffect 的闭包问题? #2323
Unanswered
vaynevayne
asked this question in
Q&A
Replies: 1 comment 3 replies
-
先上结论:如果只是为了解决闭包问题,可以直接使用 useRef,没必要用 useReactive。 细说 useReactive: 其实 useReactive 约等于 useRef + proxy + useUpdate 所以你这里 另外,useReactive 配合 useContext 时更新渲染有问题,不建议过度依赖 useReactive 这个 hook。 |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Beta Was this translation helpful? Give feedback.
All reactions