{"name":"@xstate/react","version":"2.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":"^1.6.4","react":"^16.8.0 || ^17.0.0","xstate":"^4.29.0"},"peerDependenciesMeta":{"@xstate/fsm":{"optional":true},"xstate":{"optional":true}},"dependencies":{"use-isomorphic-layout-effect":"^1.0.0","use-subscription":"^1.3.0"},"devDependencies":{"@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-node-resolve":"^11.0.1","@testing-library/react":"^8.0.9","@types/jsdom":"^12.2.3","@types/react":"^16.9.11","@types/react-dom":"^16.9.4","@xstate/fsm":"*","jest":"^26.6.3","jsdom":"^14.0.0","jsdom-global":"^3.0.2","lerna-alias":"3.0.3-0","react":"^16.12.0","react-dom":"^16.12.0","rollup":"^2.35.1","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@2.0.0","_nodeVersion":"14.18.3","_npmVersion":"6.14.15","dist":{"integrity":"sha512-Pw8uHkamrMxoV8cwnVHv570Zun7o2ktokn5bkUOrv6PufFg5JHL2URiGvbyR9JqmIxfJdXregWvCGa3pqXd7Cg==","shasum":"fa1c950483a7a500d71faaa36e6970b337ba7543","tarball":"http://registry-npm.ywwl.com/@xstate/react/download/@xstate/react-2.0.0.tgz","fileCount":51,"unpackedSize":102886,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh8q0NCRA9TVsSAnZWagAA2a4QAJO8e2RCmZOs6Yav14Ml\nlG6zU//NyEh0fxx32yFMmz58Vukytf2KXDY0Ihk+ye6C4twz/HaEcEKqhd73\ngHLMhshrzR0dAXd2HLUqG90+vv4MZ/ghVjNjxzIRBO/FLWZZNJBLdNeQXyfE\nG/yHLiqLcHHKr8RXE4jJfmHz91B94t9foowfevToxX8tN18PPSMSrv/RhaEy\nABQFzldHHriRE2fePo/pCt+6YtTW8vwJ32b+AwxcurBTyjPj+7cQYLJ58eID\nIg84/f8Sy7MBRgGRlCW6VEo0S/yvrFKD2L+q9hk/84J7H5eR1WzQkngh2xxB\nfZ2nCMs3mKEbrS4x+LfEWFJAW81+K9Z/1u4YyIa0ukdmarWepTeMmnXODY/T\nr2fsoM9+zTFPe9JgBBTWTZkkWFzlItWO5ZtECttbCIlCzy5RQ9guZf57JKdf\n72uFL42TSkkfFD4rAceFSwxi8C9N0W/3kdhgagRvC41hkpKNTMkg0qbCOEiA\nfygURxtBKTSDMKStRA0GIjGxqogbdMuf5W4iKnkW5L8M9bYBu96CbqHvSLND\nrWcuEVRtn7YvwmUM2wnLAZ33w+FWbDAmJMFAsbleR/JYv3UhDZ2LIqfnBVpT\nqEJcTuzQAMZuC5YeLCNYOk/7dVWVu6DHAZN09TwuhxeYyi0alNc2XDBi34At\n4jE+\r\n=frte\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPyq4uh6jpzjNe872P8x1haBqWw0RahONIAIH3sgYzPgIhALIv36oAv8yCz9RuUXnG47i7qZAlylQ3OUzDeG1i4B2E"}],"size":21162,"noattachment":false,"key":"/@xstate/react/-/@xstate/react-2.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_2.0.0_1643293965711_0.08208969026763602"},"_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":1643293965865,"_cnpm_publish_time":1643293965865,"dist-tags":{"alpha":"7.0.0-alpha.7","beta":"7.0.0-beta.0","latest":"6.1.0"}}