mattpocock / xstate-next-boilerplate

A performant, robust starting point for any React application

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

A performant, robust starting point for any React application


Languages

Language:TypeScript 84.8%Language:CSS 14.5%Language:JavaScript 0.7%