react-unique-key
v0.0.2
Published
It would offer you some unique keys for React Component
Downloads
7
Readme
react-unique-key
`react-unique-key` would offer you some unique keys for React Component , to avoid
error in array.map's render .
I overcame this function in Array.prototype object in this module . So when used ,
you only need to import this package in your entry pointer .
Use Pattern :
import React , { Component } from "react" ;
import "react-unique-key" ;
class Test extends Component{
constructor(){
super();
this.state = {
list : [{a , 1} , {a : 2} , {a : 3}]
}
}
render(){
return (
<div>
{
this.state.list.uniqueMap((item , index) => {
return <p key={item['unique_key']}>index</p>
})
}
</div>
)
}
}
LINCESE
MIT