r/reactnative • u/beatpaq • 2d ago
Could you recreate this CSS animation in React Native?
I've never used react native.
0
Upvotes
r/reactnative • u/beatpaq • 2d ago
I've never used react native.
2
u/Intrepid-Anywhere255 2d ago
If you are using Reanimated, this maps to one shared progress value and an animated style for translateX, translateY, and rotateZ through 0, 5, 0, -5, then back to 0. Run it with withSequence and withTiming on the UI thread, triggered by the button press, so React does not rerender on every frame.
1
u/davidbalbino 1d ago
yes, pretty much what the other comment said. something like this should get you close:
then put
styleon anAnimated.Viewand callwiggle()on press. if the CSS one also moves on X/Y just add translateX/translateY to the same transform. tweak the durations until it looks the same, depends of the easing they used