{"name":"@xstate/react","version":"3.2.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.36.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.8.4","xstate":"*"},"gitHead":"eefd0d5abd0c1e18ff3d6b9b7e0c79ee905194b6","_id":"@xstate/react@3.2.0","_nodeVersion":"16.19.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-Oxz1WB3/Z9IHjrd2uCIQGjGA8P7UsTTPc3YuIbIsgDgfSntQuvvjR0rZlL9NKQltrCRTXvzGf/wI95wAc2u7Uw==","shasum":"02827566a3d2ed48ab0a2ab83af5076899682b4e","tarball":"http://registry-npm.ywwl.com/@xstate/react/download/@xstate/react-3.2.0.tgz","fileCount":50,"unpackedSize":81020,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBBQ7EStEoHQxtB/GG/zQh6jluMKcryk+d+iiGdlCCswAiEApFF9pefj01+XN/NVSkfpBCFXBngVi2MMMBwALObfrpw="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj6ggfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpsbw/+O8GL9a3tCM9VUOXa8vY4Pyb3H1WP4Vx/uKhQT/Ba7A0yvg4e\r\nD9doeFwOaNepVay9uYStXrCfbs5Wia0XFPC5j6uRl4XvI0pdfXoGV1YxGG8H\r\nViPOfne3lID4jdNVi1aYo6kunV0sP/bwnwrYR35fG1rXcrJDk9TO07e965vz\r\n3HfXs7OZ7a6o8VoYGx/gv+H9yDiqpmRuLJ71mVEqH0a2a99pNOnmJHQb4Tkk\r\nrwGvVMO7/D6k1lyb6wwEo0VPL5N+BLClzTSDCsrq/sMN8UJeYJCVAOcpaAsV\r\n9jL1UW9R/VxdF0m6Fp64DjiB+R4No/VfU2dPdauIreZZzf6+Yz/80F1OE9hj\r\npesuWcRISkk4dwJVtPjwB0lv6TsNdjgvXTNSxO/WZ7n0I2G3G2s1Z1YBORgX\r\n5oK3lKv+rS09e8I7oqnOrpAY5iNWwl5I+E+EPdPIiFqwOaXAbfXxTlkEh6DL\r\n6dMukW+gh+K1f0ijWZmaPAud14B9GSQjBKyjq/MJ3UFvwnR8l9NdmwaPp8E6\r\nHgGYkVPNJnG1iypw5XHUGQCJjy0IVjQBUrvLAjpwlHoMJCxMqWFazU8WFCqS\r\njJMQFT3f4lh2GQt77lo4QZ6tCePgfBEyKqnrJkPHqlYhqT2mM8ckSr+xKSG3\r\n7fWFBLYufNMAz8vPaFcN1+FpNVdifWL3Md4=\r\n=1tUH\r\n-----END PGP SIGNATURE-----\r\n","size":14850,"noattachment":false,"key":"/@xstate/react/-/@xstate/react-3.2.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.2.0_1676281887510_0.8046744972016278"},"_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":1676281887689,"_cnpm_publish_time":1676281887689,"dist-tags":{"alpha":"7.0.0-alpha.7","beta":"7.0.0-beta.0","latest":"6.1.0"}}