No overload matches this call.
Overload 1 of 2, '(props: Props | Readonly<Props>): Legend', gave the following error.
Type '{ content?: ContentType | undefined; iconSize?: number | undefined; iconType?: IconType | undefined; layout?: LayoutType | undefined; align?: HorizontalAlignmentType | undefined; ... 480 more ...; onBBoxUpdate?: ((box: DOMRect | null) => void) | undefined; }' is not assignable to type 'IntrinsicClassAttributes<Legend>'.
Types of property 'ref' are incompatible.
Type 'LegacyRef<ReactElement<any, string | JSXElementConstructor<any>>> | undefined' is not assignable to type 'LegacyRef<Legend> | undefined'.
Type '(instance: ReactElement<any, string | JSXElementConstructor<any>> | null) => void' is not assignable to type 'LegacyRef<Legend> | undefined'.
Type '(instance: ReactElement<any, string | JSXElementConstructor<any>> | null) => void' is not assignable to type '(instance: Legend | null) => void'.
Types of parameters 'instance' and 'instance' are incompatible.
Type 'Legend | null' is not assignable to type 'ReactElement<any, string | JSXElementConstructor<any>> | null'.
Type 'Legend' is missing the following properties from type 'ReactElement<any, string | JSXElementConstructor<any>>': type, key
Overload 2 of 2, '(props: Props, context: any): Legend', gave the following error.
Type '{ content?: ContentType | undefined; iconSize?: number | undefined; iconType?: IconType | undefined; layout?: LayoutType | undefined; align?: HorizontalAlignmentType | undefined; ... 480 more ...; onBBoxUpdate?: ((box: DOMRect | null) => void) | undefined; }' is not assignable to type 'IntrinsicClassAttributes<Legend>'.
Types of property 'ref' are incompatible.
Type 'LegacyRef<ReactElement<any, string | JSXElementConstructor<any>>> | undefined' is not assignable to type 'LegacyRef<Legend> | undefined'.ts(2769)
No quick fixes avail
I am trying to export
LegendPropsandLinePropsfrom recharts but while using<Legend {..props}/>and<Line {..props} />. I am getting following error.Also, I see that the same issue was fixed for
Area. Hoping to get it fixed forLegendandLine.Here is the link of that fixe issue 2156