Skip to content

Commit d260a3e

Browse files
committed
fix: widen LabelList formatter parameter type for recharts 3
recharts 3's LabelFormatter no longer accepts a formatter typed to take only number - the value parameter can be string | number, so a (v: number) => ... function isn't assignable to it. Widen the parameter and keep the existing runtime numeric check.
1 parent cfbfb33 commit d260a3e

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: number) => (v > 0 ? v : '')}
134+
formatter={(v: string | number) => (typeof v === 'number' && v > 0 ? v : '')}
135135
/>
136136
</Bar>
137137
</BarChart>

0 commit comments

Comments
 (0)