0๐
โ
Your data can be accessed using this.state.data
, you need to refactor
const data = this.state
to
const {data} = this.state
Which is same as saying
const data = this.state.data
0๐
{
Array.isArray(data) ?
data.map((data,index) => <div key={index}>{data.bind your data}</div>) : error
}
think this should help.
Source:stackexchange.com