@exodus/rive-react-native

中文文档
9.8.2-exodus.1发布于 2026/04/27MITTypeScriptESM + CJS零依赖近 30 天下载 1.1万

Rive React Native

原始使用文档
文档目录12 节
  1. Table of contents
  2. Rive Overview
  3. Getting Started
  4. Supported Devices
  5. Examples
  6. Migration Guides
  7. Contributing
  8. Issues
  9. Native SDK Version Customization
  10. Default Behavior
  11. Customizing Versions
  12. Version Resolution Priority

Build Status Discord badge Twitter handle

Rive React Native

Rive hero image

🚀 New Runtime Available!

The new Rive React Native runtime is now available. Built with Nitro for improved performance and better React Native integration.

Try it now:

We're actively gathering feedback to improve the new runtime. Please share your thoughts and report any issues you encounter.

Migration Timeline:

  • Short term: Complete the new runtime, see Feature Support and Roadmap
  • Medium term: Address major concerns in this legacy package while supporting migration
  • Long term: Full migration to the new package

A React Native runtime library for Rive.

This library is a wrapper around the iOS/Android runtime, providing a component and ref pattern for React Native applications.

Table of contents

Rive Overview

Rive is a real-time interactive design and animation tool that helps teams create and run interactive animations anywhere. Designers and developers use our collaborative editor to create motion graphics that respond to different states and user inputs. Our lightweight open-source runtime libraries allow them to load their animations into apps, games, and websites.

:house_with_garden: Homepage

:blue_book: General help docs

🛠 Resources for building in Rive

Getting Started

Follow along with the link below for a quick start in getting Rive React Native integrated into your multi-platform applications.

Getting Started with Rive in React Native

API documentation

Supported Devices

Because this runtime library has a dependency on the Rive Android and Rive iOS runtimes, the supported devices align with each of these dependencies minimum supported devices, as well as the minimum device requirements of the React Native framework.

  • iOS: 14.0+
  • Android:
    • Minimum SDK version: 21
    • Target SDK version: 33

Examples

Check out the example/ folder to run an example application using the Rive React Native runtime. It runs on the local build of this library, and showcases a number of ways to use the Rive component and useRef hook pattern:

  • Setting a Rive file via a URL, or asset in the Android/iOS projects
  • Displaying single or multiple animations / artboards on one component
  • Setting up and maniuplating a state machine via inputs
  • ...and more!

Steps:

  1. Run yarn bootstrap
  2. cd example
  3. yarn expo run:android or yarn expo run:ios

iOS:

  • You may need to run pod install (first time) or pod update RiveRuntime (updates to the underlying Rive iOS runtime) in the example/iOS folder to get the runtime installed or updated

Migration Guides

Using an older version of the runtime and need to learn how to upgrade to the latest version? Check out the migration guides below in our help center that help guide you through version bumps; breaking changes and all!

Migration guides

Contributing

We love contributions! Check out our contributing docs to get more details into how to run this project, the examples, and more all locally.

Issues

Have an issue with using the runtime, or want to suggest a feature/API to help make your development life better? Log an issue in our issues tab! You can also browse older issues and discussion threads there to see solutions that may have worked for common problems.

Native SDK Version Customization

⚠️ Advanced Configuration This section is for advanced users who need to use specific versions of the Rive native SDKs. In most cases, you should use the default versions that come with the library. Only customize these versions if you have a specific requirement and understand the potential compatibility implications.

Important: If you customize the native SDK versions and later update rive-react-native to a newer version, you should revisit your custom version settings. The custom versions you specified may not be compatible with the updated rive-react-native version. Always check the default versions in the new release and test thoroughly.

Default Behavior

By default, rive-react-native uses the native SDK versions specified in package.json:

"runtimeVersions": {
  "ios": "6.18.2",
  "android": "11.4.0"
}

These versions are tested and known to work well with this version of rive-react-native.

Customizing Versions

You can override these default versions using platform-specific configuration files:

iOS (Vanilla React Native)

Create or edit ios/Podfile.properties.json:

{
  "RiveRuntimeIOSVersion": "6.18.2"
}

Then run:

cd ios && pod install

Android (Vanilla React Native)

Add to android/gradle.properties:

Rive_RiveRuntimeAndroidVersion=11.4.0

Expo Projects

For Expo projects, use config plugins in your app.config.ts:

import { ExpoConfig, ConfigContext } from 'expo/config';
import { withPodfileProperties } from '@expo/config-plugins';
import { withGradleProperties } from '@expo/config-plugins';

export default ({ config }: ConfigContext): ExpoConfig => ({
  ...config,
  plugins: [
    [
      withPodfileProperties,
      {
        RiveRuntimeIOSVersion: '6.18.2',
      },
    ],
    [
      withGradleProperties,
      {
        Rive_RiveRuntimeAndroidVersion: '11.4.0',
      },
    ],
  ],
});

Version Resolution Priority

The library resolves versions in the following order:

iOS:

  1. ios/Podfile.properties.json → RiveRuntimeIOSVersion
  2. package.json → runtimeVersions.ios (default)

Android:

  1. android/gradle.properties → Rive_RiveRuntimeAndroidVersion
  2. package.json → runtimeVersions.android (default)

版本与发布记录

@exodus/rive-react-native 共发布 11 个版本,首次发布于 2025/09/03;过去 12 个月发布了 3 个版本。

版本发布日期距今
9.8.2-exodus.1latest2026/04/276 个月前
9.8.2-exodus.02026/04/246 个月前
9.5.12026/03/068 个月前
9.5.02025/09/261.1 年前
9.5.0-exodus.52025/09/211.1 年前
9.5.0-exodus.42025/09/211.1 年前

关于 @exodus/rive-react-native 的常见问题

@exodus/rive-react-native 是什么?

Rive React Native

如何安装 @exodus/rive-react-native?

在项目目录运行 npm install @exodus/rive-react-native,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(*)、react-native(*)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@exodus/rive-react-native 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@exodus/rive-react-native 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@exodus/rive-react-native 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=16。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@exodus/rive-react-native 可以商用吗?

@exodus/rive-react-native 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@exodus/rive-react-native 的下载量有多少?

根据 npm 官方下载统计,@exodus/rive-react-native 在 2026/10/14 – 2026/11/12 这 30 天内被下载 10,687 次,日均约 356 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@exodus/rive-react-native 还在维护吗?

最新版本 9.8.2-exodus.1 发布于 2026/04/27(6 个月前);至今共发布 11 个版本,其中过去 12 个月发布了 3 个;首次发布于 2025/09/03。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。