@xstate-ninja/react
TypeScript icon, indicating that this package has built-in type declarations

1.1.3 • Public • Published

@xstate-ninja/react

logo

This package contains XState Ninja integration for React.

npm version code style: prettier PRs Welcome


Quick Start

npm install --save @xstate-ninja/react xstate-ninja @xstate/react xstate

To track state machines in your project, do this:

import { useInterpret } from '@xstate-ninja/react'

function App() {
  const service = useInterpret(machine, { devTools: true })
}

The useMachine hook is available too:

import { useMachine } from '@xstate-ninja/react'

function App() {
  const [state, send, service] = useMachine(machine, { devTools: true })
}

Install the browser extension, open browser devtools (F12) and select the XState panel.

screenshot

Package Sidebar

Install

npm i @xstate-ninja/react

Weekly Downloads

317

Version

1.1.3

License

ISC

Unpacked Size

7.77 kB

Total Files

8

Last publish

Collaborators

  • rlaffers