{"name":"@reach/component-component","version":"0.10.1","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":"node ./build-package"},"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":"c279bc0fb9ae84aa77306c5f1a9909d088bc665c","bugs":{"url":"https://github.com/reach/reach-ui/issues"},"homepage":"https://github.com/reach/reach-ui#readme","_id":"@reach/component-component@0.10.1","_nodeVersion":"14.0.0","_npmVersion":"lerna/3.20.2/node@v14.0.0+x64 (linux)","dist":{"integrity":"sha512-oMybFLG4fgZ58RHRJdA8cXP5sD04fR1GPXvwjncabhIdaM1trcZVa7K74E8Wy5GGTPW4olJRzmJRVSPfwVLOJw==","shasum":"670d3f6e0d6f553fe2285743bf29806904d6e5a0","tarball":"http://registry-npm.ywwl.com/@reach/component-component/download/@reach/component-component-0.10.1.tgz","fileCount":5,"unpackedSize":14179,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJen+D8CRA9TVsSAnZWagAA1BYP/RAP5E/NvzFnqwtB++0S\nWRjBGcuYjnnkrqdGwRyPI0XGq2gr0BguIPLLMDuUNq6kaXEplOHdLQPf6VMH\nsqgOCkD5njI6qMI55kZuF0Q6bK487fOzJpmA+Hg83rRplZPu1g4CJk2lxBwX\nc3WddGdIVfddDdJOSOR/Xt84OTvg09HaCU5RMDq65gUN6j0yWXuJYND2qD1v\nL6awOOqQjRlTIkTUwOnFOLOAq1qlPgo3t93EF1Cf+eKatWJQDSJLNnFwEEHF\n3qNo+xFuTopxCccgWyRsLR7Ryncw76fvHp5rPIj7/wosPUVrclvEs0bPydcs\n2GkOS4Ik8Fd8EVgdymtgcLPoCDy47L1F9Hxqq/bx98ruKK5hg8KvwTUPd9fV\nc7ZLZqFKXKlpRrmvjkHdBp9LoxH9u2abHIaps9pzdEK5D5eR1oFiKcRV+boA\ngmjSQAKEOJPYmvJPCSm+zF2fRZRLI75uaZZ6IRHDs1IHpy6wdNmaSU5F3whA\n2OgCr721UHQAtu2bnfthcG3xnKROURlLOSNed3K62e1NasHvPz8+FisilJ0+\nHtTpYo9CdpYgZ/PhIXMZBCcMU97vYwproFNaruJcjtD+fUS9ire2rrhjS4WZ\n3Dx0/fHhpC5iMfAEjNMjThG5jTQbOMH1fbJ/5xs3uotP2+gQ1JxbIxlI82Q/\ns0M8\r\n=XbVp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCKa5obV9PQALVmtdYjSUCQ0v55ABckwzXflysceDNNygIgVFdemWmUUyy4+z2J7WL8irgunlIS/iBieoufI2F0Q6Y="}],"size":3646,"noattachment":false,"key":"/@reach/component-component/-/@reach/component-component-0.10.1.tgz"},"maintainers":[{"email":"blainekasten@gmail.com","name":"blainekasten"},{"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.10.1_1587536124049_0.3325758599535116"},"_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":1587536124183,"_cnpm_publish_time":1587536124183,"dist-tags":{"latest":"0.17.0","next":"0.4.0-beta.0"}}