Skip to content

useEffect的执行问题 #56

@ydm1475

Description

@ydm1475

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

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions