dillon1000/react
Commit
Browse files [DevTools] Remove use of .alternate in root and recordProfilingDurations (#30895)
Ideally we shouldn't use the `.alternate` to access previous state because ideally Fibers shouldn't have alternates. The only case it's ok to use it is when it is used to identity the stateful part of a component's identity. In a non-alternate Fiber model there would instead be another object that represents instance but in the current model it's modeled by the pair. It's not ok is to get the previous state of the tree since that would not live on the stateful part. We don't generally need this though because we have the previous state on instance.data before updating it, or passed from above.
Changed paths1 file
First-parent comparisonpackages/react-devtools-shared/src/backend/fiber/renderer.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…