{"name":"react-node-key","version":"0.0.2","description":"Automatic key-marked for React nodes, generate an unique identifier by render location","main":"index.js","scripts":{"build":"rollup --config"},"keywords":["node key","unique","react node key","file key","identifier","react keep alive","react activation"],"author":{"name":"CJY0208"},"license":"ISC","homepage":"https://github.com/CJY0208/react-node-key","repository":{"type":"git","url":"git+https://github.com/CJY0208/react-node-key.git"},"peerDependencies":{"react":">=16"},"dependencies":{"jsx-ast-utils":"^2.2.1"},"devDependencies":{"@babel/core":"^7.5.5","@babel/plugin-proposal-class-properties":"^7.5.5","@babel/preset-env":"^7.5.5","@babel/preset-react":"^7.0.0","rollup":"^1.11.3","rollup-plugin-babel":"^4.3.2","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-node-resolve":"^4.2.3","rollup-plugin-uglify":"^6.0.2"},"gitHead":"8e4183e12b9efc91c8e689cb631a3e527040fea4","bugs":{"url":"https://github.com/CJY0208/react-node-key/issues"},"_id":"react-node-key@0.0.2","_nodeVersion":"11.10.1","_npmVersion":"6.7.0","dist":{"integrity":"sha512-6IX3NGD1n4wsDAwFSdZvsD1/YEqdbOAnp5JlCtfBAA8wJjTFY5bxbKocbJW0Er9K6SYTBfbDqDkW9hj4fnfboA==","shasum":"4eeb74bad2e1efab6d6cb18223b9375132c1a630","tarball":"http://registry-npm.ywwl.com/react-node-key/download/react-node-key-0.0.2.tgz","fileCount":11,"unpackedSize":34036,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJed4AeCRA9TVsSAnZWagAAVdcQAIWEKuH9EcjUIrGLAsg7\n4Rtx0sZl8uPcL/S2TxQ8U4dLGWhhTxW6V3tqSqwkI9FpLcrS2zT6eovgaSrq\nZTTIwBo5eHMLy7mH2Q+bhCyfMJmBnMylokaA8iH3AY+gn1OV5evXl1I1Ur2f\n78LQBI0gxR93sNb1E4jQERxY2txsq4SRgx4w8/RPyz67s7lEL9tf/6cWa+Fy\nP3JizRQ5jKbp+qxLeENCo2EW9LfPqUJJx1Rs9T+TurBj2dnKWiB3cjvJdlHb\n4ukTwC+/Y9Zd7O1oEf98plTxeB8dg4ZTL9feNro7OubCpMrXrkGCefNLrox2\naYJ+UwKJ6wTcbqXRCkDqE7onfJJDM+ODbZpLvK0iZX0/yTxare/KObYRyWyw\ng0TAG8LOjNKSGosadMHwx033I/YRcA4HtXAt9KTDnwWlg47QzKvlTM9bAkOH\nNVGxzREYhd03d2eYkqdbp+0L/uART8XcEO8rPY3H5oBDRW9QmLs3vEWC60bg\nUbK5O8wXN8WZodl/Fe3RhjROi1brb3kT3YZ13jt8ksCOP62MK6HH01Tfyfym\n78Lf5tCUDrsuH76kfjm29oQu11MUHx9To9BfPfV5UmevjsVvpEHLLPYWVCjy\nqFBbhvGBNRfmqifTDXMsSqxLb309fKqG6VBBVqjUeoN/YfTO0stsBkPDO41c\nhMnY\r\n=UIe5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCCSiifLw34n90D7lOI8uIZC5Vkcf0DvmZYEmy1aq6JHQIgeov1tWlnHdhSVIRORKagVIS7c2TrgfxPVVyDV+79bp0="}],"size":10442,"noattachment":false,"key":"/react-node-key/-/react-node-key-0.0.2.tgz"},"maintainers":[{"name":"cjy0208","email":"fanluan058@gmail.com"}],"_npmUser":{"name":"cjy0208","email":"fanluan058@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-node-key_0.0.2_1584889886506_0.3448792881452232"},"_hasShrinkwrap":false,"readme":"# React Node Key\n\n[![size](https://img.shields.io/bundlephobia/minzip/react-node-key.svg)](https://github.com/CJY0208/react-node-key)\n[![dm](https://img.shields.io/npm/dm/react-node-key.svg)](https://github.com/CJY0208/react-node-key)\n\nEnglish | [中文说明](./README_CN.md)\n\nAutomatic key-marked for React nodes, generate an unique identifier by render location\n\n---\n\n## Compatibility\n\n- React v16+\n\n- Preact v10+\n\n---\n\n## Install\n\n```bash\nyarn add react-node-key\n# or\nnpm install react-node-key\n```\n\n---\n\n## Usage\n\n#### 1. Add `react-node-key/babel` plugins in `.babelrc`\n\n[Why is it needed?](https://github.com/CJY0208/react-activation/issues/18#issuecomment-564360695)\n\nThe plugin adds a `_nk` attribute to each JSX element during compilation to help the `react-node-key` runtime **generate an unique identifier by render location**.\n\n```javascript\n{\n  \"plugins\": [\n    \"react-node-key/babel\"\n  ]\n}\n```\n\n#### 2. Use `<NodeKey>` as your component's wrapper\n\n```javascript\nimport React from 'react'\nimport ReactDOM from 'react-dom'\nimport NodeKey from 'react-node-key'\n\nimport Test from './Test'\n\nReactDOM.render(\n  <NodeKey>{nodeKey => <Test key={nodeKey} />}</NodeKey>,\n  document.getElementById('root')\n)\n```\n","publish_time":1584889886657,"_cnpm_publish_time":1584889886657,"dist-tags":{"latest":"0.4.0"}}