{"name":"@reach/component-component","version":"0.17.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":"d206aefac2bede58c06a54b18d48eee7537096e0","bugs":{"url":"https://github.com/reach/reach-ui/issues"},"homepage":"https://github.com/reach/reach-ui#readme","_id":"@reach/component-component@0.17.0","_nodeVersion":"14.19.1","_npmVersion":"lerna/4.0.0/node@v14.19.1+x64 (linux)","dist":{"integrity":"sha512-0NbVKxhb0m8goB1E/agFxlGMvn1VtHbPiJAP4N7wy30VLwgfg3ucxiRED7DBsO6aw0r+r9dki2kC5ImzGykmoA==","shasum":"c8485f1cb9fe8c78c69853587593665ec515e3b5","tarball":"http://registry-npm.ywwl.com/@reach/component-component/download/@reach/component-component-0.17.0.tgz","fileCount":9,"unpackedSize":20089,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBLPwL8kgJc3HQylHUvAt7L9PUSL3KyGKf+FVYtyjSDyAiEAnBgF5nEqmoAXc/4gHvCEQqVlzrfjLB85GhG7QZoX6LQ="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiX5wpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoO8Q//XCL2MR+l6taBSn7KTJe2XaEnXUM4LceueflhDux0CCYVXh5t\r\ntD64fZnKdUrbzKXzUNGEGuhpDXoCJnahhLr6u/FZORANyI1+Clh5YVeBObfJ\r\nMifQw2HxTm2jdVd015DKXcs86kLEazan6SaFl8MiYbuIQy1SqFjxQUCOcre4\r\nf6sgnQ3zxloDu3HTsey2XeVujyImV4BeTXPRbOf+APdUYqkhT5jbAvGLnvPg\r\ndyDDBXSAHBozzpV4jPXbqa4R8+Jj/+jjPDLupUWZ/+SqBkcsppsOQmKZRY6N\r\nCmNqIi0k2yKg8YgfQb2R01fLHbTDGUO6lUw6+du2StoqxfS+FuUFVxTDkRyt\r\n0itYE6cn280o+fnYQDuRdY6PPtz/mQtczhEdn8ZI5alO5xuzQHctFBf4opT5\r\nuMND90T1lhw/FGhc2YoswIwWCi7ZQxv2IDxwhcZky7sv5ergpl7+Hlk3D2OO\r\nr67vGrf5V1ZCTBMSNXgwRpNRjnw5j8ZYnK5TjnXz7auBSpID2GaL4HXC6L88\r\ng3wg4+Js9GFE3hT5Gc0aul5VKPkXDCd1M+5RyCn5bBSZ/gZnrXwVBbZbGpOH\r\nQqeFz1qgtqnpHbCmh8OHMdPF0uNpebNmEEBCJshjUeXJ9iM2arjc3C4F3x2x\r\nwTeo0FYmxs1ZwIQWzxmWV72lraWufDakFuc=\r\n=E8ye\r\n-----END PGP SIGNATURE-----\r\n","size":4231,"noattachment":false,"key":"/@reach/component-component/-/@reach/component-component-0.17.0.tgz"},"_npmUser":{"name":"chancestrickland","email":"hi@chance.dev"},"directories":{},"maintainers":[{"name":"ryanflorence","email":"rpflorence@gmail.com"},{"name":"mjackson","email":"npm@mjackson.me"},{"name":"chancestrickland","email":"hi@chance.dev"},{"name":"blainekasten","email":"blainekasten@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/component-component_0.17.0_1650433065575_0.5921902662337051"},"_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":1650433065751,"_cnpm_publish_time":1650433065751,"dist-tags":{"latest":"0.17.0","next":"0.4.0-beta.0"}}