0.0.2 • Published 5 years ago

react-unique-key v0.0.2

Weekly downloads
4
License
ISC
Repository
github
Last release
5 years ago

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