Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/junqiuzhang/babel-plugin-add-key-for-each-child
add key for each child in list
https://github.com/junqiuzhang/babel-plugin-add-key-for-each-child
babel-plugin children key react
Last synced: 7 days ago
JSON representation
add key for each child in list
- Host: GitHub
- URL: https://github.com/junqiuzhang/babel-plugin-add-key-for-each-child
- Owner: junqiuzhang
- Created: 2019-11-19T10:51:06.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T01:12:23.000Z (about 2 years ago)
- Last Synced: 2024-10-02T09:21:33.149Z (3 months ago)
- Topics: babel-plugin, children, key, react
- Language: JavaScript
- Size: 120 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Babel Plugin Add Key For Each Child
a babel plugin that add key for each react element in list
## Example
**before:**```
export default (props) => {
const num = [1, 2, 3]
return
{
num.map(o => {
return
})
}
}
```
**after:**```
export default (props => {
const num = [1, 2, 3];
return;
{num.map((o, i) => {
return ;
})}
});
```## Usage
**.babelrc**```
{
"plugins": [
"@babel/plugin-transform-react-jsx",
"./src/index.js"
]
}
```