{"name":"react-node-key","version":"0.0.1","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":"553ec43b3becdbebe05f110dc8df8085ca704979","bugs":{"url":"https://github.com/CJY0208/react-node-key/issues"},"_id":"react-node-key@0.0.1","_nodeVersion":"11.10.1","_npmVersion":"6.7.0","dist":{"integrity":"sha512-jT8/3m0fNRzvKnROyKh+ivGw1nnoa6426ogvJryIgjOCtAj83V0nWjGuQRpII3FKw2GRG/r6r11RImUECmUY8A==","shasum":"a80f9b9e4b3c6cef24476745ecfc42360432b69f","tarball":"http://registry-npm.ywwl.com/react-node-key/download/react-node-key-0.0.1.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\nwsFcBAEBCAAQBQJed3qJCRA9TVsSAnZWagAA2s0P/30eciTItePrpNhNa5f6\nFcJD2Nc0hiu1cwZweu25zSb9ZfPEb2QCKVSnx+REmutq74KJAyMPEL4WKsi2\nfe+Lp69CASSwUw2V3G2G6cF057hIkV5LX0oUue2YGyOC3sKhvLMUcfas73v6\n+owaA29v2xwxfYXEIHB8uaNI0tOwRpn0/CS+LZq/PjJ0+dV53qpCXeo3TDI6\nbNwwXrxl6zJYjyLp15qnAMH62g6Y6fVoik+slcvvJ4C4PgSLGYEDF7znFatI\nH5vcSX+eT4An3NWl4Z5DYuenpC+Cz7X9xGyR6CnBtjlNV1+xWLJbxPk2dEXw\nmkDUjKiFMOjUrXmodxgGGMr8+Td+9ThxykBm7uyAlXzhlffAyUWgKJV7VzGG\ndZViGLTm9VZb+n0wh/ZGZi7wgcen6j5kNJb3TQUXNf73FuyO4qqe6upOiL7d\nAzhNrjFXCLuq3NIm4hj9J7jZDokKmLEyYY8n+70ABnWa+xrbWq6rEDT+7r9n\nmi7/jcTNAlgwJzsEJlFapXS7J+sI2uUeobogb6fgjAJ+etoV/Y4ZmDuIsszf\n3rFKlov4rvO4mAPVBdWnuQbeu/mtOEg9SDxPRcB3EHQQI5MXk6JgH3IN0Tq9\nCKEHoigTKL5Y5iaQfVpTASs37Z2tZclS5ZG6Iexke89vZHs6zwBhpnIGvsDc\nIaF6\r\n=6Ihe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHEnEpXC23gnT5Dv0aiQsrzKvDy1EGrangZiLvb671uJAiEAt0Pw8K+fOehdBrPWjTcVqKDsj5bqPujhkt2nBw/6pdc="}],"size":10442,"noattachment":false,"key":"/react-node-key/-/react-node-key-0.0.1.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.1_1584888456975_0.9313324050547551"},"_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":1584888457142,"_cnpm_publish_time":1584888457142,"dist-tags":{"latest":"0.4.0"}}