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
https://github.com/BetaSu/big-react/blob/master/packages/react-reconciler/src/updateQueue.ts文件下,测试的组件就为批处理那节所写的组件,num初始值为100,click事件里有三个setNum,传入一个函数,返回num+1。在我测试的时候结果是101,按理来说是103,查看了一下processUpdateQueue,发现每次传进来的baseState都为100,应该在每次处理完update后将newState赋值给baseState,供下一个update的使用,这样结果就是103。请大佬指点一下,是我理解错了还是应该是这样的。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
https://github.com/BetaSu/big-react/blob/master/packages/react-reconciler/src/updateQueue.ts文件下,测试的组件就为批处理那节所写的组件,num初始值为100,click事件里有三个setNum,传入一个函数,返回num+1。在我测试的时候结果是101,按理来说是103,查看了一下processUpdateQueue,发现每次传进来的baseState都为100,应该在每次处理完update后将newState赋值给baseState,供下一个update的使用,这样结果就是103。请大佬指点一下,是我理解错了还是应该是这样的。
The text was updated successfully, but these errors were encountered: