Created by Valor Software
This example shows how to integrate Recoil in Next.js and initialize state on server-side.
Recoil is an experimental set of utilities for state management with React used by some teams at Facebook. This example takes the code from the redux examples and demonstrates how it would be implemented with Recoil.
Deploy the example using Vercel or preview live with StackBlitz
Execute create-next-app
with npm, Yarn, or pnpm to bootstrap the example:
npx create-next-app --example https://github.com/brunos3d/nextjs-recoil-initial-state-ssr
# or
yarn create next-app --example https://github.com/brunos3d/nextjs-recoil-initial-state-ssr
# or
pnpm create next-app --example https://github.com/brunos3d/nextjs-recoil-initial-state-ssr
Deploy it to the cloud with Vercel (Documentation).