Automatic key-marked for React nodes, generate an unique identifier by render location
npm install react-node-key

English | 中文说明
Automatic key-marked for React nodes, generate an unique identifier by render location
---
- React v16+
- Preact v10+
---
``bash`
yarn add react-node-keyor
npm install react-node-key
---
#### 1. Add react-node-key/babel plugins in .babelrc
The 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.
`javascript`
{
"plugins": [
"react-node-key/babel"
]
}
#### 2. Use as your component's wrapper
`javascript
import React from 'react'
import ReactDOM from 'react-dom'
import NodeKey from 'react-node-key'
import Test from './Test'
ReactDOM.render(
document.getElementById('root')
)
``