Thanks for helping out! This guide covers everything you need to get a local checkout running, send a PR, and (if you have publish access) cut a release.
- Node: see
.nvmrc(nvm useorfnm usepicks it up).engines.nodeis the same version. - pnpm: pinned via
packageManagerin the rootpackage.json. Install and enable Corepack so the correct version activates automatically (Node 25 and later no longer bundle it):If you use a standalone pnpm 11 install instead, its automatic version switch can't start pnpm 12. Upgrade it withnpm install -g corepack corepack enablenpm i -g pnpm@12.
git clone https://github.com/pmndrs/react-spring
cd react-spring
pnpm install
pnpm exec playwright install chromium # one-off, needed for browser-mode VitestNow you're cooking. 👨🏻🍳🥓
| Task | Command |
|---|---|
| Watch-build all packages | pnpm dev |
| Run the docs site | pnpm docs:dev |
| Run the demo hub | pnpm demo:dev |
| Full test suite | pnpm test (types + unit + e2e) |
| Unit tests (watch) | pnpm vitest --project unit |
| Single test file | pnpm vitest run packages/core/src/SpringValue.test.ts |
| Type-check | pnpm test:ts |
| Lint | pnpm lint |
| Format | pnpm format |
Vitest aliases @react-spring/* to the package source, so unit tests don't need a prior build. Anything outside Vitest (docs, publishing) does — run pnpm build first.
pnpm isolation gotcha:
node_modulesis non-hoisted. If you hitCannot find module 'foo'after adding an import, addfooto the workspace'spackage.json— don't add a hoist rule.
- Target branch:
next(the active line).mainmay exist but isn't the merge base. - Commits: follow Conventional Commits (
feat:,fix:,chore:, …). commitlint enforces this on thecommit-msghook. - Changeset: if your change affects published behaviour, run
pnpm changesetand flag only the package(s) you changed (usually one). All@react-spring/*packages are version-locked (afixedgroup in.changeset/config.json), so changesets bumps the rest to the same version automatically — you don't flag them yourself. Docs-only or internal-tooling changes don't need one. - Pre-commit:
oxfmt --checkruns via husky. If it fails, runpnpm formatand re-commit. - Start from an issue: link one that describes what a user sees going wrong (
Resolves #…). If there isn't one, open it first with the[bug]template, so we can agree on the problem before reviewing a fix. - Keep PRs small and focused — one fix per PR. Other behaviour changes you notice go in their own issue or PR.
- Fix the cause: find the line that causes the bug and fix it there, so every way of hitting it is covered. See "Fixing a bug" in
CLAUDE.md. - Run the checks yourself: CI doesn't run on a first-time contributor's PR until a maintainer approves it, so run
pnpm format:check,pnpm lint,pnpm check:typesandpnpm test:unitbefore opening it. - Tests: add them to the module's existing test file, check they fail without your fix, and assert what a user can observe (what a promise resolves with, which callbacks run), not internal state.
- Description: say what the user sees and why it happened, and call out anything that changes for existing code. The diff covers the rest.
- AI tools are welcome: read and run what they produce before you open the PR, and only claim what you've checked.
(Maintainers only — needs npm publish access.) We use changesets. All packages are version-locked.
Changesets are added per PR (see Sending a PR) and accumulate on next, so a release just bumps and publishes them:
- Apply the bump (updates package versions and internal deps):
pnpm vers
- Publish. This cleans, installs, builds, type-checks, runs unit tests, and publishes via changesets:
Tags are not pushed automatically (
pnpm release
pnpm releaserunschangeset publish --no-git-tag). After publishing, draft the GitHub release notes manually and update the changelog onreact-spring.dev.
Enter pre-mode first, then follow the simple release flow:
pnpm changeset pre enter beta # or alpha, nextIf you're stuck in pre-mode and need a normal release:
pnpm changeset pre exit