Migrating from v3 to v4
Migrating guide from < 4.x
If you are migrating to rive-react-native
note the following changes below.
Breaking API Changes
Ref API
.play()
- Invoking the.play()
API on the Riveref
animationNames: [String]
->animationName: String
To play a singular linear animation, use the
animationName
propertyTo play (and mix) multiple linear animations together, you will have to do this via a state machine and pass in
true
for theisStateMachine
flag in this.play()
API
.pause()
- Invoking the.pause()
API on the Riveref
This API no longer requires passing any arguments to invoke, as it will pause a singular playing animation or state machine
.stop()
- Invoking the.stop()
API on the Riveref
This API no longer requires passing any arguments to invoke, as it will stop a singular playing animation or state machine
General Usage
When rendering the
<Rive>
component, we highly recommend specifying either ananimationName
orstateMachineName
prop explicitly, otherwise, if you do not provide either of these props:iOS
may play the first state machine it finds in the Artboard as a defaultAndroid
may play the first linear animation it finds in the Artboard as a default
Note, the default behavior will change in a next major release, whereby the default play will be a state machine
React Native
Bumping the
react-native
dependency fromv0.63.4
tov0.65.0
Bumping the
react
dependency from16.13.1
tov17.0.2
Android
Bumping the Kotlin version from
1.5.20
to1.7.10
If you intend to run Rive on Android devices, please update to 4.0.1
at the least, which includes a crucial bug fix on the render lifecycle