Recoil-Next is a continuation of the Recoil state management library for React. This project was created because the official Recoil project is no longer being updated or maintained. Since the official Recoil has been discontinued, this fork aims to continue supporting Recoil with:
- Active maintenance and ongoing development
- Modern React 18+ compatibility
- Full TypeScript support with complete type definitions
- Improved build system with individual package builds
- Better developer experience with enhanced tooling
Website: https://recoiljs.org (Original Recoil documentation)
For the original Recoil documentation, visit: https://recoiljs.org/docs/introduction/core-concepts
Note: This is a continuation of Recoil. The original documentation is still relevant for learning Recoil concepts and APIs.
This continuation of Recoil includes several improvements:
- Active Maintenance: Ongoing development and bug fixes
- Modern React 18+ Support: Full compatibility with the latest React versions
- Complete TypeScript Migration: All packages are now written in TypeScript with full type safety
- Individual Package Builds: Each package can be built independently
- Modern Tooling: Uses Vitest for testing, Rollup for building, and modern ESLint/Prettier
- Self-Sustaining Packages: Each package has its own build system and can be published independently
- Enhanced Developer Experience: Better error messages, improved debugging, and modern development tools
This monorepo contains the following packages:
recoil- Core Recoil state management libraryrecoil-relay- GraphQL integration with Relayrecoil-sync- External state synchronizationrefine-next- Type checking and validation utilitiesrecoil-shared- Shared utilities and polyfills
The Recoil-Next package lives in npm.
To install the latest stable version, run the following command:
npm install recoil-nextOr if you're using yarn:
yarn add recoil-nextRecoil-Next is a drop-in replacement for the original Recoil library. You can migrate your existing Recoil project with minimal changes:
Replace recoil with recoil-next in your package.json:
{
"dependencies": {
"recoil-next": "^0.2.0"
}
}Simply change your import statements from recoil to recoil-next:
// Before
import {atom, selector, useRecoilState, useRecoilValue} from 'recoil';
// After
import {atom, selector, useRecoilState, useRecoilValue} from 'recoil-next';Your existing Recoil code will work exactly the same. All APIs, behavior, and functionality remain identical to the original Recoil library.
Development of Recoil-Next happens in the open on GitHub, and we are grateful to the community for contributing bugfixes and improvements. Read below to learn how you can take part in improving Recoil-Next.
Recoil-Next is MIT licensed.