Closed MadCcc closed 11 months ago
Patch coverage: 100.00
% and project coverage change: +0.03
:tada:
Comparison is base (
2470fec
) 96.25% compared to head (ba5ff8c
) 96.29%.:exclamation: Current head ba5ff8c differs from pull request most recent head 542d569. Consider uploading reports for the commit 542d569 to get more accurate results
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
由于新渲染的组件 render 阶段要比旧组件的 unmount 阶段更早,所以在 react 17 以下会出现先插入新组件的 style 标签,再执行旧组件的卸载,最后执行新组件的 mount,计数+1。在旧组件卸载时计数实际上还没有增加,所以就回触发删除逻辑。 ref: https://codesandbox.io/s/aged-cdn-qjxmpz?file=/src/App.tsx