dillon1000/react
Commit
Browse files [Fiber] Don't reaquire HostSingletons during dev effect validation (#37113)
Stacked on #37112 In dev effects are validated using a double-invoke technique. To do this the effects are destroyed and recreated during a validation traversal. However this same disappear and reappear path is used when Offscreen Fibers go hidden and HostSingletons have unique behavior when going hidden. So now that the double invoke effects process happens during hydration it is more common to have your Singletons be released and acquired during this validation phase which is observable most notably by having extra attributes removed from them. The prior commits in this stack deal with preserving non-react owned attributes on release however it is semantically incorrect to release and acquire the singleton during this validation because it isn't really an effect, it simply lives in this traversal to avoid having to do another traversal during the commit. This change adds a bit of info to the release and acquire path to only conditionally perform the necessary reacquire flow if we are not in the validation phase.
Changed paths3 files
First-parent comparisonpackages/react-dom/src/__tests__/ReactDOMSingletonComponents-test.js ModifiedM packages/react-reconciler/src/ReactFiberCommitWork.js ModifiedM packages/react-reconciler/src/ReactFiberWorkLoop.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…