Contributing to Rive React
We love contributions! If you want to run the project locally to test out changes, run the examples, or just see how things work under the hood, this guide will help you get started.
Local Development Setup
This runtime consumes specific versions of the Rive JS/WASM runtime. The build process ensures that the correct dependencies are used for each renderer package.
Installation
-
Clone the project from GitHub:
git clone https://github.com/rive-app/rive-react.git cd rive-react
-
Install the necessary dependencies:
npm install
Development Server
To build the src/
files and watch for changes, run the development server. This will automatically rebuild the project when you save a file.
npm run dev
Running Examples with Storybook
We use Storybook to develop and showcase examples. The stories are located in the /examples
directory.
-
Start the Storybook server:
npm run storybook
-
In a separate terminal, run the development server to see your changes to the core library reflected in Storybook:
npm run dev
Running Tests
We have a suite of unit tests in the /test
directory. When adding new features or fixing bugs, please add or update tests accordingly.
To run the entire test suite:
npm test
Making Changes and Submitting a Pull Request
- Create a new feature branch from
main
. - Make your changes, including adding tests and updating documentation as needed.
-
Follow our commit message conventions. This helps us generate a clear changelog.
- For bug fixes:
Fix: Fixing a return type from useRive
- For documentation:
Docs: Adding a new link for another example page
- For features/breaking changes:
Major: Restructuring the useRive API with new parameters
- For bug fixes:
-
Push your branch to GitHub and open a pull request against the
main
branch.
Bumping the JS/WASM Runtime
Many features and fixes come from the underlying @rive-app/canvas
and @rive-app/webgl
runtimes. To update to a new version:
- Change the version number for the relevant
@rive-app/*
packages in the rootpackage.json
. - Run
npm install
to get the new versions. - Test the changes locally using Storybook and the test suite to ensure no regressions.
- Submit a pull request with your changes.
When a pull request is merged, a new version of the packages will be automatically deployed based on the commit messages.