xstate-react

Package for using xState with React.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
xstate-react
0.1.16 years ago6 years agoMinified + gzip package size for xstate-react in KB

Readme

React XState
Package for using xState with React.

Features

A checklist of supported and planned features:
  • x Provider/Consumer from Context API
  • x onEntry, onExit
  • x actions
  • x nested state charts
  • x parallel state charts
  • data
  • activities

Setup

Install npm package
npm i xstate-react

Usage

export default reactXState({
  name: "trafficLight",
  machine: Machine({ ...config })
  actions: ({ dispatch, transition, data }) => ({ ...actions })
})