{"name":"@reach/component-component","version":"0.7.0","description":"Declarative React Component Definitions","repository":{"type":"git","url":"git+https://github.com/reach/reach-ui.git","directory":"packages/component-component"},"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"},"gitHead":"c6c10662e6eaf229594e4d6e6a38d8c9baa35ffa","bugs":{"url":"https://github.com/reach/reach-ui/issues"},"homepage":"https://github.com/reach/reach-ui#readme","_id":"@reach/component-component@0.7.0","_nodeVersion":"13.5.0","_npmVersion":"lerna/3.19.0/node@v13.5.0+x64 (linux)","dist":{"integrity":"sha512-47SORkCea8vCXjSspptJIOoWb2ved1KQWYGbtQQxQTPeqMfaTScjZmNPgyXhOmuU5SMAAz6sSUIOYUzS5BFutA==","shasum":"57c156ba50e6667434c811e2891cfa216ce83690","tarball":"http://registry-npm.ywwl.com/@reach/component-component/download/@reach/component-component-0.7.0.tgz","fileCount":8,"unpackedSize":27855,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd/vDjCRA9TVsSAnZWagAAAkIP/iEVs+3XUI7Jzf/3W7Ap\nmHUtQcpln6BX4UQhna68J3kkQNzcjJPob7c9hIwkkxK3C3HaH68P7pUZRzm2\ngfTGjUA0A4e6dcSxBGHPMVN9smbKUCqpXgFe7CYWVBKZ2FihjfEAl3F9PGN8\n/6auDDt2vjxUVQxQ56nvViNLsGk/MFREHcOa8dNNIke/+GAVRylFgelpQRZj\ne6vacwG7RDlPurzLoSK/y3Sq2883UPVxPwyDC0+jGlOeZPcFrQwB/qanIeSn\n8gpRnlEZnI0F36sDr6f6iKNEPfg1VcGbw5sl+uqzhu8AlNEYhcPwx7ofvCAC\n9wAdyAXQuG0RQ8/1p0q7zBI9TQNziSdS45KdjvcH7oBy6sYuY4wMsDzkbBTk\nmgjvK7LH4bDWcqYPbyQsMdbm+wa5Ic7RJDY9uQcggRYDwNOEoYn0bZvZpPGs\n2EqGIPVbCmWxeJFnN7qn9M7aZo6PZ64WZLVo7RRTrajOdHtySS143xgRkXhG\nToN/L087+DvW/2WZIY625/ikUq7W51Xyr3JE7bBFMgS/P6GIxGiiskMJtevV\nPOvqL7LZP6shVMnA3emsfnQdBiIDR94hGkqkNna4F7pZtclHug0rbTAcuhIO\nKkEFcT2TLJl0LqiRhMf50z7m31l6Qnw7gxMTyup0UMxcokR25Aht3iJNmEg6\nCu+M\r\n=Q90b\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCtoIroqlsdzbxWIRAPNtiIK8mRalv3M0i13u/lLTs4CAIgAiLtS7njaYBta7sjGS8sbsG3qDQKHWnFSjomwTwt/8M="}],"size":5731,"noattachment":false,"key":"/@reach/component-component/-/@reach/component-component-0.7.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.7.0_1576988899479_0.9999745182469628"},"_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":1576988899584,"_cnpm_publish_time":1576988899584,"dist-tags":{"latest":"0.17.0","next":"0.4.0-beta.0"}}