Prevent view flattening for direct host children of ViewTransition#36012
Open
zeyap wants to merge 16 commits intofacebook:mainfrom
Open
Prevent view flattening for direct host children of ViewTransition#36012zeyap wants to merge 16 commits intofacebook:mainfrom
zeyap wants to merge 16 commits intofacebook:mainfrom
Conversation
Wherever the reconciler checks supportsMutation before running view transition logic, add an else-if branch gated on enableViewTransitionForPersistenceMode for persistent renderers (Fabric). This follows the pattern that supportsMutation guards mutation-mode-only logic, and persistent mode should have its own branch rather than being lumped under a single supportsViewTransition capability flag. For now the persistent mode branches duplicate the mutation logic. The flag defaults to false in all channels.
…n out of ReactFiberConfigWithNoMutation
…n out of ReactFiberConfigWithNoMutation
Summary: - turn on enableViewTransition feature - stub shim - run some mutation config fn at persistence mode too
Better reflects that this signals the transition has started rather than initiating it.
…enable startViewTransition
Add finalizeViewTransitionChild renderer config function called during completeWork for HostComponents that are direct children of a ViewTransition boundary. Fabric implements it by injecting collapsable: false to prevent native view flattening. DOM is a no-op. Uses a stack cursor (viewTransitionCursor) to track whether the current fiber is inside a ViewTransition — ViewTransition pushes true, HostComponent pushes false (acting as a boundary).
85b3cb9 to
0d55141
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
finalizeViewTransitionChild(type, props)renderer config function, called duringcompleteWorkfor HostComponents that are direct children of a<ViewTransition>boundarycollapsable: falseto prevent native view flattening, which would remove the view from the platform hierarchy and break view transition animationsviewTransitionCursorstack cursor to efficiently track whether the current fiber is inside a ViewTransition —ViewTransitionComponentpushestrue,HostComponentpushesfalse(acting as a boundary so only direct host children are affected)Test plan