Chartjs-How to get data from JSON ReactJs

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.

Leave a comment