-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
Describe/explain the bug
The type for the pointSymbol prop from ResponsiveLine<T> is wrong.
Example:
type ChartDatum = {
x: string;
y: number;
stalled: boolean;
};
type ChartSeries = {
id: string;
data: readonly ChartDatum[];
};
// ...
return (
<ResponsiveLine<ChartSeries>
pointSymbol={({ datum, size, borderWidth }) => {
// @ts-expect-error
console.log('Stalled data is at:', datum.stalled); // datum.stalled -> any
console.log('But the typing thinks it is at:', datum.data?.stalled); // datum.data?.stalled -> boolean
return (
<circle
r={size / 2}
fill="#0e7490"
stroke="#22d3ee"
strokeWidth={borderWidth} />
);
}}To Reproduce
Steps to reproduce the behavior:
git clone git@github.com:macabeus/mizuchi.gitgit checkout a7365f5- Check the
as neveronsrc/report-generator/ui/components/AttemptsChart.tsx
Expected behavior
No as never should be necessary to type this code
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels