{"name":"@reach/component-component","version":"0.4.0","description":"Declarative React Component Definitions","main":"index.js","module":"es/index.js","scripts":{"build":"node ../../shared/build-package"},"author":{"name":"React Training","email":"hello@reacttraining.com"},"license":"MIT","dependencies":{"prop-types":"^15.7.2"},"peerDependencies":{"react":"^16.4.0","react-dom":"^16.4.0"},"devDependencies":{"react":"^16.10.2","react-test-renderer":"^16.10.2"},"gitHead":"0f3d2c7e530cd80e1d1bd338182ac89a3ba23999","_id":"@reach/component-component@0.4.0","_nodeVersion":"13.0.1","_npmVersion":"lerna/3.17.0/node@v13.0.1+x64 (linux)","dist":{"integrity":"sha512-5ofEOKLjcm7/jSw2wosliOqVOV0LvQEJ/QJoVa/mCQ8ASYdqJz6scYPoU687fiJlfS7WORIAfFX7n8ojzDNwqQ==","shasum":"eef22d4eb704839301ebd35986448709bf92e411","tarball":"http://registry-npm.ywwl.com/@reach/component-component/download/@reach/component-component-0.4.0.tgz","fileCount":8,"unpackedSize":27426,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdsKobCRA9TVsSAnZWagAALQ4P/i+HZtxQTtB1/U1rpAy8\njGzbHrb59VU88VKZcJSGmXXV1e8RAFKe3VSKyAtEQMc0sINIkoLrYESLux6w\nqZsRw1ZbceKD8k4gU5EJ18xrr1CPZd8ZIl1oyAhCHoDfb1Dyesn9XWNG48Ga\n1GPPOLAsCNqfiFLF+hl8b7HgBfT29Ewz+6D+mh/TSJsOlVQSiKdNSq7K5aBt\nploSPGmCPfKqpCbtZoZPzkOMNuPTnvNztfL96gvTkUABKRqPxMhWXQCUadmf\nz0XOg0NeqlI9Wi9gz0jLQgSpkMgrYOXKKY2kFRsyBu4nKFXEksji/Zr9rZ95\ne+6NvGtBH6DVyCAQChj60B5zK4iByWHYWjCjOJuVIdiU/pgPtfYgNFIQ8hLW\nwzRV5Z+AbjUQfOtO70DDf3iCQE0ZCWIvTsoMnDhBk0p7EPe3awXnoOhACqlo\n+Jv2t5tFE21o5uBCrUyk8wGvrUhgymPtQoSAk4l9VVBMffTMP2T6dtIGOGNP\nupwbVFy8bkZsr5uvC1FowUT1ut4dV9wo/e9KJC+T5DgE2ZMnw88FwxqhT1dN\nNDyEzksIByvF2OlktvHmsJsoSlKfl7/t4SIHQ4CapGxNfIq+R5jKNhkfMQQ9\nC14aODbUH5A4GQ36jUO0tZE6ST2o37AJ9kXI12WGxQEYpwZvzBh67eaZ9l1M\n8Adv\r\n=mS9D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCqmTnxRymg0f69PDfnG2HwFKllTdG+NB4VxF4fx+mIDwIhAL95ALF8lDsDFJdixNddZRWXJaw/47ZI4T/znHlVu9um"}],"size":5681,"noattachment":false,"key":"/@reach/component-component/-/@reach/component-component-0.4.0.tgz"},"maintainers":[{"email":"chance.strickland@gmail.com","name":"chancestrickland"},{"email":"npm@mjackson.me","name":"mjackson"},{"email":"rpflorence@gmail.com","name":"ryanflorence"}],"_npmUser":{"name":"mjackson","email":"npm@mjackson.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/component-component_0.4.0_1571858970867_0.019382862533558365"},"_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":1571858970982,"_cnpm_publish_time":1571858970982,"dist-tags":{"latest":"0.17.0","next":"0.4.0-beta.0"}}