Animations are very important to create a great user experience. Stationary objects must overcome inertia as they start moving. Objects in motion have momentum and rarely come to a stop immediately. Animations allow you to convey physically believable motion in your interface.
React Native provides two complementary animation systems: Animated for granular and interactive control of specific values, and LayoutAnimation for animated global layout transactions.
To animate things you must use the createAnimatableComponent composer similar to the
Animated.createAnimatedComponent
.
The common components View
, Text
and Image
are precomposed and exposed under the Animatable
namespace.
Repo on Github
If you have your own component that you wish to animate,
simply wrap it with a Animatable.View
or compose it with:
React Native's Animated library reimplemented.
It provides a more comprehensive, low level abstraction for the Animated library API to be built on top of and hence allow for much greater flexibility especially when it comes to gesture based interactions.
Note:
Link native code with
react-native cli
if react-native < 0.60
View all example on react-native-reanimated example