{"name":"react-node-key","version":"0.2.0","description":"Automatic key-marked for React nodes, generate an unique identifier by render location","main":"index.js","scripts":{"build":"rollup --config","format":"prettier --write \"./src/**/*.js\"","manual:publish":"npm run build && np --no-cleanup --yolo --no-publish"},"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"},"sideEffects":false,"peerDependencies":{"react":">=16"},"dependencies":{"jsx-ast-utils":"^2.2.1","szfe-tools":"^0.0.0-beta.7"},"devDependencies":{"@babel/cli":"^7.10.3","@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","babel-plugin-import":"^1.13.0","np":"^6.2.5","prettier":"^2.2.1","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"},"_id":"react-node-key@0.2.0","dist":{"shasum":"c937390208de87a0361bce87b507ccef35fb0f35","integrity":"sha512-fC5ZVz3TwhSY0o1hw08R/V/Ze/exfhaeDllRucuvEH2Xj1qT4Y4IoSr93BftcVJHJFt3fmmTCV/mGk+LX5x20w==","tarball":"http://registry-npm.ywwl.com/react-node-key/download/react-node-key-0.2.0.tgz","fileCount":13,"unpackedSize":34449,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfw8JhCRA9TVsSAnZWagAAUA4P/Awy0RpRewgqxjoXbWeR\nmros6XSULfe+eFHFNcHW9MWUspHymqos/joCaLnk7Xj/1N6LYJFJYJwtaoLA\n1LuG6CoC4xWONMh64adFtTDc7KELossOJ+5jp/SZ3sxE+RVrZc81uPPYy7+a\nIwfaPajsb4M8cBBazD/NM6LPE6VDpi3EdMWzdcN6l4THvtWUXNYjDPPii9P9\nH7LQ4Qtgoav9iyWx8ssUT8/BkHAQFmfpIsCs+aJXBVuBwEDmWDM0NyM1BSzH\ntnz0TEjn1xzeU1vV+6uQ/mHS37w3UeJesDjmCsc/TWWm9H0qMdOka0YCmy41\nMnoAu7G2YMiTZ3suBzIH+CH5qmxv5WP1uHY6a0ZX+uHYJYZbZgO86a6zss3E\ndETSvNxZulsHHGz/Mcf5hjtfYQAKICMe20lZoZAV3leq7r0N2jdOk/82LvcR\nzMbLNeKLjjtDvg0Ui4IYVdjPjgyUW6yeOoxsfsO9u0Zk1Oh+aZpHBM2CgLS6\n6nkJ5ocQqhkTyxoJRok4wX7rAD7HqyYGNs+lxocbCX0BIkaDT8zMeR2wAi0Q\n7bFKVxvv2hTUlSuc1YjndGk2Of6PSAZuzyri58gLwPYU5UvHdFUtR/PBxbGU\nn2izlRMDV18HPagfppZLaGtQOZm4RAptQsYI/Go1SJTxXX+IXfqdngC1hcMy\n/0pj\r\n=GGFk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGS8wfcHlBQtCFBlWPvkprCZn2Wau73xDzp7VvBNPkfsAiEAsNSA4zqwOz0jNd3A0FQUQ42eWiqKMD5NxRXL9JMPXKs="}],"size":10680,"noattachment":false,"key":"/react-node-key/-/react-node-key-0.2.0.tgz"},"_npmUser":{"name":"cjy0208","email":"fanluan058@gmail.com"},"directories":{},"maintainers":[{"name":"cjy0208","email":"fanluan058@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-node-key_0.2.0_1606664800883_0.7364688630507878"},"_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":1606664801027,"_cnpm_publish_time":1606664801027,"dist-tags":{"latest":"0.4.0"}}