0
http://codepen.io/naveennsit/pen/oxRwYM如何顯示數組中的數據反應?
嗨 我想顯示列表中的數組數據。我得到未定義的錯誤爲什麼?
這裏是我的代碼 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'))
刪除''',應該是'<應用程序名稱= {站}> ssssss' –
謝謝了solutuion ..任何反應js好教程 – user944513