Skip to main content

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

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.

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() replace property.value for 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

2. Instance Creation

The useViewModelInstance hook handles ViewModel resolution and instance creation for you — in most cases you don’t need to call these methods directly.

3. Property Value Access

4. Nested ViewModelInstance Access

5. List Property Access

6. Artboard Access

7. Async Setup Pattern

Synchronous useMemo chains for ViewModel setup should be replaced with useState + useEffect, or simplified with the useViewModelInstance hook.

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 the RiveFile object via the useRiveFile hook, enabling file caching, multiple instances from one file, and better resource management.
Enhanced Data Binding: Direct access to ViewModel and ViewModelInstance objects, enabling initialization hooks, multiple instances, and support for all property types (lists, images, artboards).
Improved Error Handling: Error handling is improved. See the error handling documentation for more information.

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

See loading Rive files for more information.

4. Component Migration

See React Native runtime and props documentation for more information.

5. View Reference Migration

See Rive ref methods for more information.

6. State Machine Inputs (Deprecated)

These methods are deprecated. Migrate to data binding instead.
See state machine inputs for more information.

7. Rive Events (Deprecated)

These methods are deprecated. Use data binding triggers instead.
See runtime events for more information.

8. Data Binding

The new runtime significantly improves data binding by giving you direct access to ViewModelInstance objects. This enables:
  • Initialization hooks - Set initial property values before rendering with onInit callback
  • 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
Main API changes:
  • Property hooks take viewModelInstance instead of riveRef
  • Hooks return objects instead of tuples
  • Parameters are swapped: (path, viewModelInstance) vs (riveRef, path)
See react-native/data binding for more information.

9. Out of Band Assets

See loading assets for more information.

10. Text Run Updates (Deprecated)

Direct text run methods (.setTextRunValue(), .getTextRunValue()) are deprecated. Migrate to data binding strings instead.
See text runs for more information.

11. Callbacks

See data binding for more information.

Getting Help

If you encounter issues:
  1. Check the new runtime documentation
  2. Review the Data Binding guide
  3. See the example app
  4. Visit the Rive community forums
  5. Report issues on GitHub