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

useEffect的执行问题 #56

Open
ydm1475 opened this issue Sep 1, 2023 · 0 comments
Open

useEffect的执行问题 #56

ydm1475 opened this issue Sep 1, 2023 · 0 comments

Comments

@ydm1475
Copy link

ydm1475 commented Sep 1, 2023

请可以运行这个例子,https://codesandbox.io/s/relaxed-ace-m9x292?file=/App.js 点击后组件的destory执行顺序为
image

而在本项目中执行顺序与官方实现不一致,下图为本项目中的打印顺序为
image

官方实现在没有标记的ChildDeletion的组件会先执行 commitPassiveUnmountEffects_complete(), 从而执行destory方法。并不是像我们实现的直接先执行所有要删除组件的destory。

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

No branches or pull requests

1 participant