http://codepen.io/naveennsit/pen/oxRwYM
HI I am trying to display data of array in list. I am getting undefined error why ?
here is my code http://codepen.io/naveennsit/pen/oxRwYM
var stations = [
{call:'station one',frequency:'000'},
{call:'station two',frequency:'001'}
];
class App extends React.Component {
render (){
var stationComponents = this.props.name.map(function(station) {
return <div className="station">{station.call}</div>;
});
return <div>{stationComponents}</div>;
}
handleClick(e){
alert('--')
}
}
React.render(<App name='{stations}'>ssssss</App>,document.getElementById('app'))
', should be<App name={ stations }>ssssss</App>