this.Sections = [];
//by using block scope introduced by let, I am able to pass a unique value to each different child, in order to uniquely identify them without any other dependencies
for(let i = 1; i <= 4; i++) {
this.Sections.push(
<div style={styles.section} key={'parent_' + i} className='section'>
<div style={styles.header} key={i} onClick={() => this._onClick(i)} className='header'></div>
</div>
)
}
Created
March 8, 2017 01:56
-
-
Save cotyembry/8c75652dcc3f951e2657bd0a28fa348e to your computer and use it in GitHub Desktop.
This shows an awesome way to manage unique keys with references uniquely identified
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment