This documentation is nowhere near finished - but here's the article that inspired this repo.
XState Next Boilerplate
The officially recommended way to get started with XState and Next.js.
Features
Predictable state management
XState is the industry-leading tool for managing state with statecharts. Visualise your app's logic before you even write a line of code.
Best practices built in
Want to cut down on re-renders? Use the best of React and XState's useSelector
to make your app performant and robust.
Important Files
createXStateContext.ts
globalState.machine.ts
_app.tsx
Layout.tsx
Things I plan to add
Generators
React Boilerplate uses PlopJS to write generators. It was one of the things that made me fall in love with DX, so I'd love to add it here.
Tests
I'd love to write a simple structure for unit testing your machines (if required), and also showing off @xstate/test
.