Skip to content

Instantly share code, notes, and snippets.

@freiksenet freiksenet/1unique_key.js Secret
Last active Aug 29, 2015

Embed
What would you like to do?
var UniqueKeyContainer = React.createClass({
render() {
var someContents = this.props.listOfStuff.map((stuff) => (
<li key={stuff.id}>{stuff.title}</li>
));
return (
<ul>
{someContents}
</ul>
);
}
});
var UniqueKeyContainer = React.createClass({
render() {
var someContents = this.props.listOfStuff.map((stuff, index) => (
<li key={index}>{stuff.title}</li>
));
return (
<ul>
{someContents}
</ul>
);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.