1π
β
I had the same problem a while ago. You have to check if the length of the object youβre giving to the chart is more than 0 then render it.
{ data.length > 0 && <Line options={options} data={data}/> }
Source:stackexchange.com