-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Web LA] Add EntryExitTransition
#6232
Merged
Merged
Conversation
This file contains 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
piaskowyk
reviewed
Jul 15, 2024
packages/react-native-reanimated/src/layoutReanimation/web/transition/EntryExit.web.ts
Outdated
Show resolved
Hide resolved
packages/react-native-reanimated/src/layoutReanimation/web/transition/EntryExit.web.ts
Outdated
Show resolved
Hide resolved
packages/react-native-reanimated/src/layoutReanimation/web/transition/EntryExit.web.ts
Outdated
Show resolved
Hide resolved
piaskowyk
approved these changes
Jul 16, 2024
This was referenced Sep 24, 2024
This was referenced Oct 1, 2024
This was referenced Oct 3, 2024
This was referenced Oct 4, 2024
This was referenced Oct 5, 2024
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
This PR adds
EntryExitTransition
to set of transitions available onweb
.This transition is different from others, therefore logic behind its creation is also different.
Two animations
First approach was to run 2 animations -
exiting
andentering
. While it seemed like an easier approach, there were few problems:end
/cancel
)transform
was overriden by animations and we need to use it to put element back in its starting position)While I haven't observed any flickers caused by having 2 animations, arguments above made me try seconds approach)
Dynamic keyframe
Second approach to this problem involves creating dynamic keyframe animation - just like in case of other transitions. First we obtain data of both
exiting
andentering
animations. Then we perform two operations:exiting
animation (unshift
is used to make sure that it will be placed at the beginning of keyframe timestampsIn 2. we have to make sure that both animations will fit in one keyframe, therefore
exiting
animation is squeezed into interval[0,49]
andentering
animation runs from50
to100
.Examples
Nagranie.z.ekranu.2024-07-8.o.14.28.38.mov
Nagranie.z.ekranu.2024-07-8.o.14.42.40.mov
Test plan
Verified on
DefaultLayoutTransitions
example.