{"name":"@reach/component-component","version":"0.13.0","description":"Declarative React Component Definitions","author":{"name":"React Training","email":"hello@reacttraining.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/reach/reach-ui.git","directory":"packages/component-component"},"scripts":{"build":"ts-node --transpile-only ../../scripts/build-package $npm_package_name"},"dependencies":{"prop-types":"^15.7.2"},"peerDependencies":{"react":"^16.4.0","react-dom":"^16.4.0"},"main":"dist/index.js","module":"dist/component-component.esm.js","gitHead":"c5234721d372e2ab2a7745475007605e78d18895","bugs":{"url":"https://github.com/reach/reach-ui/issues"},"homepage":"https://github.com/reach/reach-ui#readme","_id":"@reach/component-component@0.13.0","_nodeVersion":"15.6.0","_npmVersion":"lerna/3.22.1/node@v15.6.0+x64 (linux)","dist":{"integrity":"sha512-DlKj5EbSFgXO8Y4XtD5QtCnym+rcVr2+sv7rDQtyAZR5KNfmbsZu+oy7rUe69AJoIU3BNc2C3t3jWM1o14jKwQ==","shasum":"06b53eab2f51150337f9604558835eaf9b25576c","tarball":"http://registry-npm.ywwl.com/@reach/component-component/download/@reach/component-component-0.13.0.tgz","fileCount":10,"unpackedSize":34686,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgD22hCRA9TVsSAnZWagAA5u0P/ijIPdTQf8cnhIY6Sqcx\nOqcLSy0WEcNGQY92xwd1PvFFBy9/1J08SVlH/TzCq+LHWC4pvxthRrzvVR5o\nlUS3WZ8++ET9zgMU2mOUu1OsKJB7dGMiJgJLekgifPOzcMenidXMosddohOd\noUbLLdhTyPtYAdAuW45rAwJRDt5ZJ0DTsEr1PfXXz9BhxGZuSUre/tcLalMt\nX2WJIIiCWcRrGXW/P4crEZdOum6oM2x4cIqMGMggN/zAMdT6v1/M1mL3m6AS\n8ZQXIOj2ms7XoLWk1GPr3FT4fIwjBDbvpx4yW8SNX4oU38uXSr9iFxYHcTGo\nhUaeZtjqUllbsDR6DBtxvInEPE08RjsxCj1lVDFTUq4xL59I1gjlKeWj9waH\nZwLjLAsP6TwPwC1Y+hp2++NBZGfNLxl9+G4I4xXv/Np0NP4Tv01snkhC8VY6\n1vAN76uAOh7y/nIOEBataZxUhIqZjfj1WgPmBG9uZWCjKaKZ5UmVBaXZUN+/\nsIDQj1SwJHRD0RaniFWXW9blOpmfIFTdzMMQQ5o9wd6Lqi/ph9/syGhZbSWE\novl5tIA+8zHP9kTeXihJNoqA9YvhqC5nErBmA+g7zQNhR8GrQX3nZUOxYYF0\nc4iQiwYALtG2JNVJ1xMiHZgq6yjKz66IeQMT4fffJzrukBVOMUI93nPwUwWt\nTCje\r\n=Omxx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGxKCNfSICWMIHNkRZbvRRlgwInpqBh3PBVlnkZruz4VAiA2w2ZdCfKihQgDc3ixnNTLfTgML+/iwofqIDSoTNtJMA=="}],"size":7208,"noattachment":false,"key":"/@reach/component-component/-/@reach/component-component-0.13.0.tgz"},"_npmUser":{"name":"mjackson","email":"npm@mjackson.me"},"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.13.0_1611623841438_0.03615045486069035"},"_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":1611623841589,"_cnpm_publish_time":1611623841589,"dist-tags":{"latest":"0.17.0","next":"0.4.0-beta.0"}}