{"name":"@reach/component-component","version":"0.5.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.11.0","react-test-renderer":"^16.11.0"},"gitHead":"7e33672d882cd6df77ac8cdb76b6b4a21dbf28c2","_id":"@reach/component-component@0.5.0","_nodeVersion":"13.0.1","_npmVersion":"lerna/3.18.3/node@v13.0.1+x64 (linux)","dist":{"integrity":"sha512-lP2pS7Bx0cVFNUQgC8TP1xRy9hs6Bfd2H4vD5l2SFnnYvOWr7cNWmu4rGQZ1y+fdznS7JgrTz0PrLNA2tDFsTQ==","shasum":"db2855a03795566ad301167a33822c7b886cd0fe","tarball":"http://registry-npm.ywwl.com/@reach/component-component/download/@reach/component-component-0.5.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\nwsFcBAEBCAAQBQJduxXhCRA9TVsSAnZWagAAgp4P/3mwAOh85Kwh3Zlb/g0H\nQAv8JzIxYy39tAgVEX7Fv9z1AhWovZvd/Oce/O5c+8AzF+xPD15VQHBi08xu\nNoQrdE1jUPi58zFl5Bf/B1bQw5PDw+snrEaZhSy/zbnga5yWCGtrXndWaL7+\n4K0KkYcuLIjlac0b5Ygbis3pSlPFCxswAjjdO2vbjoh3Kp0HenQ9YDHVYh/h\nDoDdD14/OEbYffyucdS56QxnC2pDDdud5gk6CIWfqV1qGrjq+VLTCoerqxFh\n5cPExDEE1N7DFhZzJ0HJqyxcp+CViInWtb88kHnlXSEdqJT5bZU7lkKJ5Jjc\nNKWXOV/5DlmrDgrijqu4pOqZ9xHSwWz0qhhZ0Du1k5T2HO7MOXfeSOp9dsGR\ndugI62+C3n5BkO0xoAvl+P1u85k9wU2ovPFMSrWxnQ9iIXpeicBi6HWw75OQ\n/q2aKN5gJbFUYHA18aRrWUoGu7+qA/jeD5z+154eg61uK6ESsWe7EdOwXK9u\nRAUF7sFiGwKT3tiNTGTewayVTeeLP4JwIdRxe1uBYkUh/IbQu+OYpSFqeUdj\nJ+kJZn+1TSdXoZJOQpM5Y13vf5KiucVhmhy4oXtmeyBFzG+uEOioIaMgUCsT\n7/Z/BxorRHhGuJ90wjwtK5IuIkvFhZPdiTG+E+luqM7PBt+o9IeoxGxhTDl3\npJsJ\r\n=SLJp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC0PI2sRhWCjcp8wLStW48zWAtUyTkG+C/X2eFLMvCjjgIhAPM1rSaG7VHRAaXiU73SGb50jfUcg0Vi0I946PYc5V/b"}],"size":5679,"noattachment":false,"key":"/@reach/component-component/-/@reach/component-component-0.5.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.5.0_1572541920744_0.7130447030581895"},"_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":1572541920860,"_cnpm_publish_time":1572541920860,"dist-tags":{"latest":"0.17.0","next":"0.4.0-beta.0"}}