dillon1000/react

Commit

New children notify fragment instances in Fabric (#33093)

When a new child of a fragment instance is inserted, we need to notify
the instance to keep any relevant tracking up to date. For example, we
automatically observe the new child with any active
IntersectionObserver.

For mutable renderers (DOM), we reuse the existing traversal in
`commitPlacement` that does the insertions for HostComponents. Immutable
renderers (Fabric) exit this path before the traversal though, so
currently we can't notify the fragment instances.

Here I've created a separate traversal in `commitPlacement`,
specifically for immutable renders when `enableFragmentRefs` is on.
Browse files
Changed paths4 files
First-parent comparison
M packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js ModifiedM packages/react-native-renderer/src/ReactFiberConfigFabric.js ModifiedM packages/react-native-renderer/src/__tests__/ReactFabricFragmentRefs-test.internal.js ModifiedM packages/react-reconciler/src/ReactFiberCommitHostEffects.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…