{"name":"@xstate/react","version":"3.0.0","description":"XState tools for React","keywords":["state","machine","statechart","scxml","state","graph","react","hook"],"author":{"name":"David Khourshid","email":"davidkpiano@gmail.com"},"homepage":"https://github.com/statelyai/xstate/tree/main/packages/xstate-react#readme","license":"MIT","main":"lib/index.js","module":"es/index.js","types":"lib/index.d.ts","typesVersions":{"<4.0":{"lib/index.d.ts":["index.v3.d.ts"]}},"sideEffects":false,"directories":{"lib":"lib","test":"test"},"repository":{"type":"git","url":"git+ssh://git@github.com/statelyai/xstate.git"},"scripts":{"clean":"rm -rf dist lib tsconfig.tsbuildinfo","build":"tsc && tsc --outDir es --module es2015 && rollup -c","test":"jest","prepare":"npm run build"},"bugs":{"url":"https://github.com/statelyai/xstate/issues"},"peerDependencies":{"@xstate/fsm":"^2.0.0","react":"^16.8.0 || ^17.0.0 || ^18.0.0","xstate":"^4.31.0"},"peerDependenciesMeta":{"@xstate/fsm":{"optional":true},"xstate":{"optional":true}},"dependencies":{"use-isomorphic-layout-effect":"^1.0.0","use-sync-external-store":"^1.0.0"},"devDependencies":{"@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-node-resolve":"^11.0.1","@testing-library/react":"^13.0.0","@types/jsdom":"^12.2.3","@types/react":"^17.0.43","@types/react-dom":"^17.0.14","@types/use-sync-external-store":"^0.0.3","@xstate/fsm":"*","jest":"^26.6.3","jsdom":"^14.0.0","jsdom-global":"^3.0.2","lerna-alias":"3.0.3-0","react":"^18.0.0","react-dom":"^18.0.0","rollup":"^2.69.0","rollup-plugin-replace":"^2.2.0","rollup-plugin-terser":"^5.1.2","rollup-plugin-typescript2":"^0.30.0","ts-jest":"^26.5.6","typescript":"^4.5.2","xstate":"*"},"_id":"@xstate/react@3.0.0","_nodeVersion":"14.19.1","_npmVersion":"6.14.16","dist":{"integrity":"sha512-KHSCfwtb8gZ7QH2luihvmKYI+0lcdHQOmGNRUxUEs4zVgaJCyd8csCEmwPsudpliLdUmyxX2pzUBojFkINpotw==","shasum":"888d9a6f128c70b632c18ad55f1f851f6ab092ba","tarball":"http://registry-npm.ywwl.com/@xstate/react/download/@xstate/react-3.0.0.tgz","fileCount":47,"unpackedSize":90131,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQClthp6AOY37GheHvz9/TivizyqpoXlwEsGm5TDuSq3nwIhANhhqI7bIKZ/fk5OlAK4P+4fqpvy0HzRADyJTzaW6GoV"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiUEIwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmplnA/+Ow2THVxKiDaqSG9e1qyRSTBBQtyE8P1+MPBJ4EZY0AIKSofa\r\nqg02d2uf6kA5PMZQLmvRynfxLhxdn9ZEt8URkMrma8wy1S5ylltXnIjOtfoe\r\nRwHiqlYvIn0SfAmJ3YLeXMA8IxctgSAeuFSSsqeaPeeoP1o7v7leOmQ4ET3i\r\n/d7uvEOjsqMAt6Xu/+Nd1UgFlOVVebvdzg3Zu1fZmbj57jbSWC/WTDmuoAA0\r\nZJmoU6bcOC51LyE68njl1oCj9Y3fuc0fK5CbS3k/AFB0mF2BjBhzZk0CgOjH\r\nh7nXYYFiet9/76vZPJfNK3HEZkQTpVJDbkiH+IqxyCenw2kYX+GrH8lU/nlk\r\n9Ml4uu1pewAhJYg6pLZ0z6mNbDiu8vx2ybpOxn5sMzd9dWJ5Gxb+KHUrvqTb\r\nEYuLjvi08WkYU5y7MkYZRPeoWxHX0TdF0w889cPQKoAqzBA3De+ySwj3u7L8\r\nis39UAQEYih+khfz8zZ5Cexa33fqnBgiHnrd8jsvAdmX+RKLuQtwbSeYMECp\r\n+6ihBV4Szga5SE+KRTc07IGXjHDDr9IIhNV5lNHF6okIQIqnDf0gqSgqYjDp\r\ndkYy4dTJW8K4vxkHHGWS7atir5V+ee5zTCcmuSEJMIqHQtvsCFHELTjIVZaC\r\n5Lp04B0v8xeHeEyi0t8g1/qZgWpDO95JTco=\r\n=biQC\r\n-----END PGP SIGNATURE-----\r\n","size":19652,"noattachment":false,"key":"/@xstate/react/-/@xstate/react-3.0.0.tgz"},"_npmUser":{"name":"xstate-release-bot","email":"david@stately.ai"},"maintainers":[{"name":"xstate-release-bot","email":"david@stately.ai"},{"name":"andarist","email":"mateuszburzynski@gmail.com"},{"name":"davidkpiano","email":"davidkpiano@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react_3.0.0_1649426992313_0.11068005434465156"},"_hasShrinkwrap":false,"readme":"# @xstate/react\n\nThis package contains utilities for using [XState](https://github.com/statelyai/xstate) with [React](https://github.com/facebook/react/).\n\n- [Read the full documentation in the XState docs](https://stately.ai/docs/xstate-react).\n- [Read our contribution guidelines](https://github.com/statelyai/xstate/blob/main/CONTRIBUTING.md).\n\n## Quick start\n\n1. Install `xstate` and `@xstate/react`:\n\n```bash\nnpm i xstate @xstate/react\n```\n\n2. Import the `useMachine` hook:\n\n```tsx\nimport { useMachine } from '@xstate/react';\nimport { createMachine } from 'xstate';\n\nconst toggleMachine = createMachine({\n  id: 'toggle',\n  initial: 'inactive',\n  states: {\n    inactive: {\n      on: { TOGGLE: 'active' }\n    },\n    active: {\n      on: { TOGGLE: 'inactive' }\n    }\n  }\n});\n\nexport const Toggler = () => {\n  const [state, send] = useMachine(toggleMachine);\n\n  return (\n    <button onClick={() => send({ type: 'TOGGLE' })}>\n      {state.value === 'inactive'\n        ? 'Click to activate'\n        : 'Active! Click to deactivate'}\n    </button>\n  );\n};\n```\n","publish_time":1649426992514,"_cnpm_publish_time":1649426992514,"dist-tags":{"alpha":"7.0.0-alpha.7","beta":"7.0.0-beta.0","latest":"6.1.0"}}