mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
e70db3db9b
Stacked on #30979.
The problem with the previous approach is that it recursively walked the
tree up to propagate the resulting time from recording a layout effect.
Instead, we keep a running count of the effect duration on the module
scope. Then we reset it when entering a nested Profiler and then we add
its elapsed count when we exit the Profiler.
This also fixes a bug where we weren't previously including unmount
times for some detached trees since they couldn't bubble up to find the
profiler.
DiffTrain build for [4549be0f84](https://github.com/facebook/react/commit/4549be0f846e7df5a4eaabf06369d93bd120271e)