{"name":"@reach/component-component","version":"0.16.0","description":"Declarative React Component Definitions","author":{"name":"React Training","email":"hello@reacttraining.com"},"license":"MIT","sideEffects":["*.css"],"repository":{"type":"git","url":"git+https://github.com/reach/reach-ui.git","directory":"packages/component-component"},"dependencies":{"prop-types":"^15.7.2"},"devDependencies":{"react":"^17.0.2","react-dom":"^17.0.2"},"peerDependencies":{"react":"^16.4.0 || 17.x","react-dom":"^16.4.0 || 17.x"},"main":"dist/reach-component-component.cjs.js","module":"dist/reach-component-component.esm.js","eslintIgnore":["node_modules","dist"],"gitHead":"e4c6093db14e3cc24c26794a002dbd8c866c0387","bugs":{"url":"https://github.com/reach/reach-ui/issues"},"homepage":"https://github.com/reach/reach-ui#readme","_id":"@reach/component-component@0.16.0","_nodeVersion":"14.17.4","_npmVersion":"lerna/4.0.0/node@v14.17.4+x64 (darwin)","dist":{"integrity":"sha512-GZSQyEGGBhgu2b/wSWBWARHFiq/861XDce69AdS65Ev5h7N62bME5Cneh/P6mj7Hvxmiq6GaltMrN98xqH3+9Q==","shasum":"2b3a20e27b7ec038252d954f40cf6d6d1697151e","tarball":"http://registry-npm.ywwl.com/@reach/component-component/download/@reach/component-component-0.16.0.tgz","fileCount":9,"unpackedSize":20089,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhB4WECRA9TVsSAnZWagAAxNYQAJGLW3PhTNrrG47aT93Q\npqUHIxjJ2EiwzX/5yx9Dw6qYI3rGwe9kYGsLSBQ6p2veUk3KqBHoIfLFpTWa\nsDglgDPUz7IiaHqqcmgj4KfWlTn9JPQJizE0QPwyBCDmgXe91ZPtJ1yhUefz\nxUZn81ivv5fpObohoaAPVNhsoazPRU34bKadjYb3hdkx1q2699WJZ/SlcPjb\nzJac1pINNQ7GHKsohxw+c2Uu+sbKa359JWZcVMesCAvKTy8v9Mthl/Y6wsgq\n0Zv0TuOiYAGl8G+HPQpjtbeTx9xReShXZQEoBcUUCGF0c6M3Z27cAMgARqoc\ny++x+/RkBShM0LJyowrAd64faxvZ7ABWNlWirfIaDBvyRQDUJJkUiunmtJUl\nfAGebkVmWfcT0VE1lxV3zRU3kprPZHntcyPyXWhggKkLSEOR0e19UD+pMO4o\ncaL5mAkiuZyrpGqJLMBL3TdYcJ2fufZPLw359tfqGF8INXO+TcxPN9fsX7oC\nDxE0qWuCv5E4SHhtuHbINLB6KyNBM+QiY014btobpqYEvpIrGPzPJBFhI7JU\neZy7hMvIvltxzyi09KJSkdfJkKSl6P8ue2XRlQk4A1FIcnCp5BefpAXqVqeL\n1xwiO80o2QyxiuRTY71aa6kGizufKNQlSMFWyWuFj27hB8MwH+UBH2L0/FqF\n5RLJ\r\n=lvMq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEicN1XYKIfd6P+6IYrFe0lH5XXshnyNMkp2Hyai3iu5AiBWHlt7a+0J1X3b1QATXmKKgGABLweg/hX/6hGrUklo6A=="}],"size":4234,"noattachment":false,"key":"/@reach/component-component/-/@reach/component-component-0.16.0.tgz"},"_npmUser":{"name":"chancestrickland","email":"chance.strickland@gmail.com"},"directories":{},"maintainers":[{"name":"ryanflorence","email":"rpflorence@gmail.com"},{"name":"mjackson","email":"npm@mjackson.me"},{"name":"chancestrickland","email":"chance.strickland@gmail.com"},{"name":"blainekasten","email":"blainekasten@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/component-component_0.16.0_1627882884857_0.6288217006859951"},"_hasShrinkwrap":false,"readme":"# @reach/component-component\n\n[![Stable release](https://img.shields.io/npm/v/@reach/component-component.svg)](https://npm.im/@reach/component-component) ![MIT license](https://badgen.now.sh/badge/license/MIT)\n\n[Docs](https://reach.tech/component-component) | [Source](https://github.com/reach/reach-ui/tree/main/packages/component-component)\n\n> NOTE: This component was developed in the days before React Hooks.\n> In most cases, you should probably build your function components using hooks and use a class\n> component in the rare cases you need them. We may deprecate this component in the future.\n\nA dynamic, functional version of `React.Component`, a component component if you will. Useful for inline lifecycles and state.\n\n```jsx\n<Component initialState={{ hue: 0 }}>\n  {({ setState, state }) => (\n    <div style={{ textAlign: \"center\" }}>\n      <button onClick={() => setState({ hue: Math.random() * 360 })}>\n        Generate Triad Colorscheme\n      </button>\n      <br />\n      {[1, 2, 3].map((n) => (\n        <div\n          key={n}\n          style={{\n            display: \"inline-block\",\n            margin: 10,\n            width: \"2em\",\n            height: \"2em\",\n            borderRadius: \"50%\",\n            background: `hsl(${state.hue + n * 120}, 50%, 50%)`,\n            transition: \"background-color 200ms ease\",\n          }}\n        />\n      ))}\n    </div>\n  )}\n</Component>\n```\n","publish_time":1627882884978,"_cnpm_publish_time":1627882884978,"dist-tags":{"latest":"0.17.0","next":"0.4.0-beta.0"}}