-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Web LA] Fix default transitions. (#6124)
## Summary Yesterday we've discovered that some basic transitions don't work on web anymore. Turns out that `animationName` was `undefined`, therefore transitions were not created. This PR adds `presetName` field into transitions, so we can easily obtain their name. > [!NOTE] > Similar thing was done in #5562, so I believe that we can stick to this convention. ## Test plan <details> <summary> Tested on the following code: </summary> ```jsx import Animated, { BounceInLeft, FadeOutRight, FadingTransition, } from 'react-native-reanimated'; import { Button, StyleSheet, View } from 'react-native'; import React from 'react'; export default function BasicLayoutAnimation() { const [state, setState] = React.useState(false); const [visible, setVisible] = React.useState(true); return ( <View style={styles.container}> <Button onPress={() => setVisible(!visible)} title="Create/Remove" /> <Button onPress={() => setState(!state)} title="Update" /> {visible && ( <Animated.View entering={BounceInLeft} layout={FadingTransition} exiting={FadeOutRight.duration(500)} style={[ styles.box, { marginLeft: state ? 200 : 0, backgroundColor: state ? 'red' : 'blue', }, ]} /> )} </View> ); } const styles = StyleSheet.create({ container: { flex: 1, alignItems: 'center', marginTop: 300, }, box: { width: 100, height: 100, }, }); ``` </details>
- Loading branch information
Showing
6 changed files
with
12 additions
and
0 deletions.
There are no files selected for viewing
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
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
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
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
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
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