From 8a2ab1a1ed54264bc78a94fa9ebeb3395fd2b123 Mon Sep 17 00:00:00 2001 From: ZheyangSong Date: Fri, 16 Feb 2018 10:46:25 -0800 Subject: [PATCH] Fix Wrong Formatter Type of --- types/recharts/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/recharts/index.d.ts b/types/recharts/index.d.ts index 207471eba3..ae13044035 100644 --- a/types/recharts/index.d.ts +++ b/types/recharts/index.d.ts @@ -13,6 +13,7 @@ import { CurveFactory } from 'd3-shape'; export type Percentage = string; export type RechartsFunction = (...args: any[]) => void; +export type LegendValueFormatter = (value?: LegendPayload['value'], entry?: LegendPayload, i?: number) => any; export type TickFormatterFunction = (value: any) => any; export type TickGeneratorFunction = (noTicksProps: object) => any[]; export type LabelFormatter = (label: string | number) => React.ReactNode; @@ -370,7 +371,7 @@ export interface LegendProps { verticalAlign?: 'top' | 'middle' | 'bottom'; margin?: Partial; payload?: LegendPayload[]; - formatter?: RechartsFunction; + formatter?: LegendValueFormatter; onClick?: RechartsFunction; onMouseEnter?: RechartsFunction; onMouseLeave?: RechartsFunction;