Migrating to v0.4.0+
This release improves error transparency and loading semantics for hooks, preparing for the async experimental runtime.
useViewModelInstance Returns { instance, error }
The hook now returns a discriminated union instead of ViewModelInstance | null:
{ instance: undefined, error: null }— loading (source not ready){ instance: ViewModelInstance, error: null }— success{ instance: null, error: null }— resolved, no ViewModel found{ instance: null, error: Error }— lookup failed
- New API
- Previous API
useRiveFile Error Is Now Error
The error field is now an Error object instead of a string, and riveFile is undefined while loading (was null). isLoading is kept for convenience.
- New API
- Previous API
Property Hooks Start undefined
useRiveNumber, useRiveString, useRiveBoolean, useRiveColor, and useRiveEnum no longer read property.value synchronously on mount. The value starts as undefined and arrives via the property listener.
Quick Reference
Migrating to the Async API (v0.3.2+)
This release introduces an async-first API to prepare for the new experimental Rive runtime. Synchronous methods that block the JS thread are deprecated and replaced with async equivalents. State machine input and text run methods are deprecated in favor of data binding and will be removed entirely in the experimental runtime (and therefore in upcoming @rive-app/react-native versions).
What’s Changed
- Async methods replace all synchronous ViewModel and property accessors
- Name-based access replaces count/index-based ViewModel and artboard lookups
getValueAsync()/set()replaceproperty.valuefor reading and writing properties- State machine inputs, text runs, and events are deprecated and will be removed in the experimental runtime — use data binding instead
Migration Steps
1. ViewModel Access
- New API
- Deprecated API
2. Instance Creation
- New API
- Deprecated API
3. Property Value Access
- New API
- Deprecated API
4. Nested ViewModelInstance Access
- New API
- Deprecated API
5. List Property Access
- New API
- Deprecated API
6. Artboard Access
- New API
- Deprecated API
7. Async Setup Pattern
SynchronoususeMemo chains for ViewModel setup should be replaced with useState + useEffect, or simplified with the useViewModelInstance hook.
- useViewModelInstance (Recommended)
- Manual Async Setup
- Deprecated Sync Pattern
Quick Reference
Platform Caveats
Migrating from v0.1.0 to v0.2.0
This change updates to a new major version of Nitro to resolve a view recycling issue. See the release for more details.
The only change required is to update the version of Nitro used in your app.
Migrating from rive-react-native to @rive-app/react-native
The new Rive React Native runtime (@rive-app/react-native) is a complete rewrite built with Nitro Modules for improved performance and better React Native integration.
All your Rive graphics will still look and function the same as they did
before.
What’s New
RiveFile Ownership: You now own theRiveFile object via the useRiveFile hook, enabling file caching, multiple instances from one file, and better resource management.
ViewModel and ViewModelInstance objects, enabling initialization hooks, multiple instances, and support for all property types (lists, images, artboards).
Requirements
- React Native: 0.78+ (0.79+ recommended)
- Expo SDK: 53+ (for Expo users)
- iOS: 15.1+
- Android: SDK 24+
- Xcode: 16.4+
- JDK: 17+
- Nitro Modules: 0.25.2+
Migration Steps
1. Installation
react-native-nitro-modules is required as this library relies on Nitro
Modules.2. Update Imports
3. Loading Rive Files
- New Runtime
- Legacy Runtime
4. Component Migration
- New Runtime
- Legacy Runtime
5. View Reference Migration
- New Runtime
- Legacy Runtime
6. State Machine Inputs (Deprecated)
- New Runtime
- Legacy Runtime
7. Rive Events (Deprecated)
- New Runtime
- Legacy Runtime
8. Data Binding
The new runtime significantly improves data binding by giving you direct access toViewModelInstance objects. This enables:
- Initialization hooks - Set initial property values before rendering with
onInitcallback - Multiple instances - Create and manage multiple view model instances from the same file
- Advanced property types - Full support for lists, images, artboards, and nested view models
- Better React integration - Property hooks integrate seamlessly with React state and lifecycle
- Property hooks take
viewModelInstanceinstead ofriveRef - Hooks return objects instead of tuples
- Parameters are swapped:
(path, viewModelInstance)vs(riveRef, path)
- New Runtime
- Legacy Runtime
9. Out of Band Assets
- New Runtime
- Legacy Runtime
10. Text Run Updates (Deprecated)
- Data Binding (Recommended)
- New Runtime (Deprecated)
- Legacy Runtime
11. Callbacks
- New Runtime
- Legacy Runtime
Getting Help
If you encounter issues:- Check the new runtime documentation
- Review the Data Binding guide
- See the example app
- Visit the Rive community forums
- Report issues on GitHub