Skip to content

Commit 29ac2de

Browse files
committed
fix: type LabelList formatter param as unknown to match recharts 3's LabelFormatter
Each narrower guess (number -> string|number -> string|number|undefined) hit a new rejected member of recharts' actual RenderableText union one at a time. Widen to unknown, which is assignable regardless of that union's exact shape; the existing typeof-number runtime check already narrows it safely.
1 parent c239e6a commit 29ac2de

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/components/VoteProgressBar/VoteProgressBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export default function VoteProgressBar({
131131
dataKey="count"
132132
position="insideRight"
133133
style={{ fill: '#fff', fontSize: 11, fontWeight: 600 }}
134-
formatter={(v: string | number | undefined) => (typeof v === 'number' && v > 0 ? v : '')}
134+
formatter={(v: unknown) => (typeof v === 'number' && v > 0 ? v : '')}
135135
/>
136136
</Bar>
137137
</BarChart>

0 commit comments

Comments
 (0)