You can use datasetKeyProvider which returns random id for the each datasets. Here is one example how to use it and function which creates random string using btoa.
const datasetKeyProvider=()=>{
return btoa(Math.random()).substring(0,12)
}
return (
<React.Fragment>
<Line
data={data}
datasetKeyProvider={datasetKeyProvider}
/>
</React.Fragment>
);
CLICK HERE to find out more related problems solutions.