- Clone this repository:
git clone https://github.com/pmndrs/react-spring
cd react-spring-
Install
yarn(https://yarnpkg.com/en/docs/install) -
Preconstruct will link the packages up in a postinstall function
-
Let's get cooking! 👨🏻🍳🥓
Be sure your commit messages follow this specification: https://www.conventionalcommits.org/en/v1.0.0-beta.4/
Some Windows users may need to enable developer mode if experiencing EPERM: operation not permitted, symlink with Preconstruct. If this persists, you might be running on an unsupported drive/format. In which case, consider using Docker.
React 16.8+ has global state to support its "hooks" feature, so you need to ensure only one copy of react exists in your program. Otherwise, you'll most likely see this error. Please try the following solutions, and let us know if it still doesn't work for you.
-
For
create-react-appusers: Follow this guide: facebook/react#13991 (comment) -
For
webpackusers: Add an alias towebpack.config.jslike this:alias: { react: path.resolve('node_modules/react'), }
-
For
gatsbyusers: Installgatsby-plugin-alias-importsand add this to yourgatsby-config.jsmodule:{ resolve: `gatsby-plugin-alias-imports`, options: { alias: { react: path.resolve('node_modules/react'), }, }, },
We use changesets to publish our package now.
All our dependencies are fixed using ~ after 1414 but luckily changesets will bump them for every minor version we release.
You want to release some new features that haven't been released yet:
yarn changeset:addFollow the prompt to flag which packages need to update although with react-spring we keep all our packages at the same version.
Then you'll run:
yarn versThis will update all the packages correctly according to what version you just set with the add script & possibly update the deps within those packages.
Finally:
yarn releaseThis will build the packages, publish them & push the tags to github to signify a new release. Please then update the releases on github & the changelog on react-spring.io
Everything above applies but you must first run:
yarn changeset pre enter beta | alpha | nextIf you find you're stuck in a prerelease and trying to do a Simple Release, try running:
yarn changeset pre exit