I got the implicitly 'any type' with React Typescript when building a generate data function (for the chart). So, what type it should be? My code is:
interface dataType {
label: string;
topic: {
A: number[];
B?: number[];
C?: number[];
};
}
const generateData = ({ inputData }:dataType) => {
return {
labels: inputData.label,
datasets: [
{
label: "A",
data: inputData.topic.A,
borderColor: "black",
backgroundColor: "blue",
},
{
label: "B",
data: inputData.topic.B,
borderColor: "black",
backgroundColor: "blue",
},
{
label: "C",
data: inputData.topic.C,
borderColor: "black",
backgroundColor: "blue",
},
],
};
};
Thank you in advanced