Created
August 25, 2015 13:08
-
-
Save uxnjs01/9e489c22c6dc56bbc2a7 to your computer and use it in GitHub Desktop.
Redering List in React
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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