{"name":"@reach/component-component","version":"0.7.1","description":"Declarative React Component Definitions","repository":{"type":"git","url":"git+https://github.com/reach/reach-ui.git","directory":"packages/component-component"},"main":"dist/index.js","module":"dist/utils.esm.js","scripts":{"build":"node ./build-package"},"author":{"name":"React Training","email":"hello@reacttraining.com"},"license":"MIT","dependencies":{"prop-types":"^15.7.2"},"devDependencies":{"@babel/cli":"^7.7.5","@babel/core":"^7.7.5","@babel/plugin-proposal-class-properties":"^7.7.4","@babel/plugin-proposal-nullish-coalescing-operator":"^7.7.4","@babel/plugin-proposal-optional-chaining":"^7.7.5","@babel/preset-env":"^7.7.6","@babel/preset-react":"^7.7.4"},"peerDependencies":{"react":"^16.4.0","react-dom":"^16.4.0"},"_id":"@reach/component-component@0.7.1","dist":{"shasum":"a1aa41066fd6df4cea18aa884db8d32b24042dd1","integrity":"sha512-Pv91L/H4QNNvYeyI0KJzhW3a0NfBaRGpp29CrQebpQfypy/Wb3yN50kfwEFNSTAkoDb92Xyc+b4vZwtZHBP3tQ==","tarball":"http://registry-npm.ywwl.com/@reach/component-component/download/@reach/component-component-0.7.1.tgz","fileCount":6,"unpackedSize":11856,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeF5o9CRA9TVsSAnZWagAASCkP/0FCB4hOAjh4qHG5TS4f\nUcny/zpiX4ifrlEw33z3ZsI70XRQubEgq9zh/tm570zKZGdtEckKB7BIxI81\nkonU6s5MlzYNBUo3e4oB7Bi7smg57mkc8Esm6VXsURpUL3k+yLr+ql5Uxn+P\nZAQVVgNUgvvyyrr975Z22iubxsz2/uTzazWfvb5O66RWLFmCRxxChniNu+/4\nO1FqiQlMRsTdJyEobi7YrocD+lt1Opd+m18Yf4AGfHt686d3jhwQ0ksLeU8e\nVaOoWnpVs3mCdQSm4hwmd3epAOa7u8A0YE5jqEYFY/4mN1VeLRgznw9GemkO\nLtCDr10BhUqjz7SZt1ZUcxJL2jP3XehDESYrPbreI+l1PjTts6CqrXstgOIa\nlOWZNbY+BNakLh0jJIxtZY1Mwf/DuVzV0CzPTrimZqJttng1UtQpS8lh/xw3\nNhL2U9PVWD+HFsyNJ8CORjK6DUb3ekLE2y040NKJyfPKKSbkwZmeuJbjFt/a\nhS8QLeyfaRHQQpfy+CIcCjwP2r+f4Lnluppv/EP8yTV5yJ6NNGJPP64r6zsu\nAcfZM11K7tMHHwEbGy0XSlgxbucI5milAmi4wJdnkqjbJR1wqrTIE05krqxX\nQu0QqefVS3GUVqRFY4IUb73lJoyEQ39CmKLEW2fRBnERVLHyyu4zWKe+0bZZ\noiya\r\n=cLum\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC6N97lxIp972ng9pbaZKLiZrNozbJ3NGY3W3/LnprgEAIhAIcO8n27q4+XEZRliY5i8HqUfomqEtoZcHXYCE2HfDhn"}],"size":2440,"noattachment":false,"key":"/@reach/component-component/-/@reach/component-component-0.7.1.tgz"},"maintainers":[{"email":"chance.strickland@gmail.com","name":"chancestrickland"},{"email":"npm@mjackson.me","name":"mjackson"},{"email":"rpflorence@gmail.com","name":"ryanflorence"}],"_npmUser":{"name":"chancestrickland","email":"chance.strickland@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/component-component_0.7.1_1578605116738_0.07269498533409102"},"_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":1578605116900,"_cnpm_publish_time":1578605116900,"dist-tags":{"latest":"0.17.0","next":"0.4.0-beta.0"}}