Problem is the following:
I have data in form of a list of a few thousand elements. Some of them are duplicates, and there might be the chance of having duplicate ke
Just implement the following code in your react component...
constructor( props ) { super( props ); this.keyCount = 0; this.getKey = this.getKey.bind(this); } getKey(){ return this.keyCount++; }
...and call this.getKey() every time you need a new key like:
this.getKey()
key={this.getKey()}