Is there something wrong with my map method?
var App = React.createClass({
getInitialState(){
return {
items:[1,2,3]
}
},
renderItem(){
return(
this.state.items.map((item,i))=>
<li key={i}> {item} </li>
)
},
render(){
return(
<ul>
{this.renderItem()}
</ul>
)
}
})
Failed to see anything displayed, check console, no errors found.
source
share