How to use the @xstate/react.useService function in @xstate/react

To help you get started, we’ve selected a few @xstate/react examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github davidkpiano / xstate / packages / xstate-viz / src / index.tsx View on Github external
}> = ({ service }) => {
  const [state] = useService(service);

  return (
    <div>
      <pre>{JSON.stringify(state, null, 2)}</pre>
    </div>
  );
};

@xstate/react

XState tools for React

MIT
Latest version published 1 month ago

Package Health Score

92 / 100
Full package analysis

Popular @xstate/react functions