Answer the question
In order to leave comments, you need to log in
Why is the array not shown in the template?
Why is the array not shown in the template?
I transfer I
withdraw<Body tmp={this.state.body.json.data}/>
render(){
return (
Object.keys( this.props.tmp ).map( ( todo, index) =>
<div key={ index }>
<p>Name: {todo[index]}</p>
</div>
)
)
}
render(){
return (
Object.keys( this.props.tmp ).map( ( todo, index) =>
<div key={ index }>
<p>Name: {todo} : {index}</p>
</div>
)
)
}
Answer the question
In order to leave comments, you need to log in
tmp is an array? then you don't need Object.keys
t is already a separate element of the array, t[i] will be undefined
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question