Installation
Moti uses Reanimated 2 under the hood to drive high-performance animations on iOS, Android and Web.
#
Starter projectIf you're starting a project from scratch, or just want to play around, you can use the Expo + Moti starter.
npx create-react-native-app -t with-moti
#
Install MotiFirst, install moti
in your app:
- npm
- Yarn
#
Install Reanimated 2Moti requires that you install react-native-reanimated
. The minimum version of Reanimated it's been tested on is 2.0.0-rc.0
.
#
If you're using ExpoPlease follow the Expo instructions for installing react-native-reanimated
v2.
You'll need at least Expo SDK 40.
#
If you aren't using ExpoPlease follow Reanimated's installation instructions for v2.
#
Web supportPlease see the following guides:
#
Hermes/Android SupportMoti uses Proxy
under the hood, which is not supported on older versions of Hermes (see hermes#33).
#
If you're using React Native 0.63.xInstall v0.5.2-rc.1
of Hermes:
- npm
- Yarn
Relevant release notes for v0.5.2-rc1 here.
#
If you're using React Native 0.64.xUpgrade Hermes to 0.7.*
.
#
Possible errorAs mentioned in this Moti issue, if you don't install the correct version of Hermes, you might see this error:
If you see this, you haven't correctly installed the right version of Hermes, so please confirm that.
#
Create your first animationYour component will now fade in on the native thread at 60 FPS.