const percentColor = obj.percent_change_24h < 0 ? 'red' : 'rgb(2, 214, 19)';
constructor() {
super();
this.state = {
data: {},
trainer: [],
diagram: { },
};
this.chartData=this.chartData.bind(chartData)
}
componentDidMount(){
this.setState({
diagram:{
labels: ['Boys', 'Girls'],
datasets: [
{
label: 'My First dataset',
fillColor: 'rgba(220,220,220,0.2)',
strokeColor: 'rgba(220,220,220,1)',
pointColor: 'rgba(220,220,220,1)',
pointStrokeColor: '#fff',
pointHighlightFill: '#fff',
pointHighlightStroke: 'rgba(220,220,220,1)',
data: [3, 0],
},
]
}
})
}
папробуйте так
constructor() {
super();
this.state = {
data: {},
trainer: [],
diagram: {
labels: ['Boys', 'Girls'],
datasets: [
{
label: 'My First dataset',
fillColor: 'rgba(220,220,220,0.2)',
strokeColor: 'rgba(220,220,220,1)',
pointColor: 'rgba(220,220,220,1)',
pointStrokeColor: '#fff',
pointHighlightFill: '#fff',
pointHighlightStroke: 'rgba(220,220,220,1)',
data: [3, 0],
},
]
},
};
this.chartData=this.chartData.bind(chartData)
}
А вот это GET_CRYPTOS это сейчас у меня я так понимаю FETCH_CRYPTOS_SUCCESSда