Skip to content
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

Update 03.一文彻底搞懂ReactHooks的原理和实现.md #165

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MicroJes
Copy link

当点击事件触发再次渲染,并不会进入条件判断中的 useState。所以,cursor=2 的时候对应的变量是 num2。而其实 num2 对应的 cursor 应该是 1。就会导致setNum2并不起作用。

当点击事件触发再次渲染,并不会进入条件判断中的 useState。所以,cursor=2 的时候对应的变量是 num2。而其实 num2 对应的 cursor 应该是 1。就会导致`setNum2`并不起作用。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant