Back to Xstate

Contributing an example

examples/readme.md

4.7.1834 B
Original Source

Contributing an example

These steps assume You've forked the repo and created a branch for your PR. For more info, see the section Making changes in our CONTRIBUTING.md.

  1. In the CLI, navigate to the /examples folder. Start a new Vite project using the appropriate template (e.g. react-ts) and adding the name of the framework at the end of your example's name:
bash
pnpm create vite@latest my-example-react --template react-ts
cd my-example-react
  1. Install xstate and the library-specific beta (e.g. @xstate/react):
bash
pnpm install xstate @xstate/react
  1. Add your XState-powered demo code ✨

  2. Preview it:

bash
pnpm run dev
  1. Submit a PR!