In order to record animations in react-native similar to how they are done in WhatsApp or Viber, you can use a library called Lottie.
Lottie is a mobile library for Android and iOS that parses Adobe After Effects animations exported as JSON with Bodymovin and renders them natively on mobile and web. With Lottie, you can add high-quality animation to any native app.
To use Lottie in your react-native project, you can follow these steps:
npm install lottie-react-native --save
import LottieView from 'lottie-react-native';
<LottieView
source={require('/path/to/animation.json')}
autoPlay
loop
/>
In this example, require('/path/to/animation.json')
is the path to the JSON file that contains your animation.
speed
, progress
, and onAnimationFinish
.With Lottie, you can easily create interactive animations that are smooth and stunning, just like the ones you see in WhatsApp or Viber.
Asked: 2023-05-08 07:35:53 +0000
Seen: 8 times
Last updated: May 08 '23