Skip to content

Instantly share code, notes, and snippets.

@uxnjs01
Created August 25, 2015 13:08
Show Gist options
  • Save uxnjs01/9e489c22c6dc56bbc2a7 to your computer and use it in GitHub Desktop.
Save uxnjs01/9e489c22c6dc56bbc2a7 to your computer and use it in GitHub Desktop.
Redering List in React
var FruitList = React.createClass({
render: function() {
var fruits = [
{
id: 1,
name: 'apples'
},
{
id: 2,
name: 'oranges'
},
{
id: 3,
name: 'grape'
}
];
return (
<ul>
{fruits.map(function(fruit) {
return <li key={fruit.id}>{fruit.name}</li>
})}
</ul>
);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment