[Web] Keyframe does not work on the web
See original GitHub issueDescription
example in doc https://docs.swmansion.com/react-native-reanimated/docs/api/LayoutAnimations/keyframeAnimations#example, does not work on web (no animation).
but work fine in native platform.
export function KeyframeAnimation(): React.ReactElement {
const [show, setShow] = useState(false);
const enteringAnimation = new Keyframe({
0: {
originX: 50,
transform: [{ rotate: '45deg' }],
},
30: {
originX: 10,
transform: [{ rotate: '-90deg' }],
},
100: {
originX: 0,
transform: [{ rotate: '0deg' }],
easing: Easing.quad,
},
}).duration(2000);
const exitingAnimation = new Keyframe({
0: {
opacity: 1,
transform: [{ skewX: '0deg' }],
},
30: {
opacity: 0.5,
transform: [{ skewX: '40deg' }],
easing: Easing.exp,
},
100: {
opacity: 0,
transform: [{ skewX: '-10deg' }],
},
}).duration(2000);
return (
<View style={{ flexDirection: 'column-reverse' }}>
<Button
title="animate"
onPress={() => {
setShow((last) => !last);
}}
/>
<View
style={{ height: 400, alignItems: 'center', justifyContent: 'center' }}>
{show && (
<Animated.View
entering={enteringAnimation}
exiting={exitingAnimation}
style={{
height: 100,
width: 200,
backgroundColor: 'blue',
alignItems: 'center',
justifyContent: 'center',
}}
/>
)}
</View>
</View>
);
}
Steps to reproduce
copy code in project and run
Snack or a link to a repository
no
Reanimated version
2.9.0
React Native version
0.69.0
Platforms
Web
JavaScript runtime
No response
Workflow
No response
Architecture
No response
Build type
No response
Device
No response
Device model
No response
Acknowledgements
Yes
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:9 (2 by maintainers)
Top Results From Across the Web
CSS Animations Not Working? Try These Fixes - HubSpot Blog
Learn how to fix common CSS animation error and get your animations looking how you want them.
Read more >CSS @keyframes not working in Chrome - Stack Overflow
I have tried to use @-webkit-keyframes but the text doesn't move either in Chrome. It works fine with -webkit-keyframes and -webkit-animation .
Read more >3 Ways to Fix Keyframes if not Working in Firefox
How do I fix keyframes if they are not working in Firefox? · 1. Double-check the code · 2. Set animation duration ·...
Read more >Keyframe animation not working in Safari? - HTML & CSS
I have a keyframe animation that works just fine in firefox and chrome, but wont start in Safari for some reason. Here is...
Read more >[Solved] Safari does not accept - CSS-Tricks
So yesterday, the website was working properly only under Firefox. Today I added the -webkit- vendor prefix for the keyframes and animations, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Yeah this feature would be really nice!
Yes, but first we need to finish refactoring Layout Animations for Android & iOS which is currently in progress.
That’s right, thanks for the suggestion!