I\'m trying to display a Table of 10 Players. I get the data from via ajax and pass it as props to my Child.
var CurrentGame = React.createClass({
// get
In CurrentGame component you need to change initial state because you are trying use loop for participants but this property is undefined that's why you get error.,
getInitialState: function(){
return {
data: {
participants: []
}
};
},
also, as player in .map is Object you should get properties from it
this.props.data.participants.map(function(player) {
return - {player.summonerName}
// -------------------^^^^^^^^^^^---------^^^^^^^^^^^^^^
})
Example