From 0b78e5d95746c7a700978b5d9ac076837e066b44 Mon Sep 17 00:00:00 2001 From: Pascal Corpet Date: Mon, 18 Sep 2023 00:13:24 +0200 Subject: [PATCH] fix(pie): use readonly arrays for props as the library does not modify them --- packages/pie/src/types.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/pie/src/types.ts b/packages/pie/src/types.ts index 2fb75d4a4..66f926e8b 100644 --- a/packages/pie/src/types.ts +++ b/packages/pie/src/types.ts @@ -58,7 +58,7 @@ export interface ComputedDatum { } export interface DataProps { - data: RawDatum[] + data: readonly RawDatum[] } export interface PieTooltipProps { @@ -73,7 +73,7 @@ export type MouseEventHandler = ( export type PieLayerId = 'arcLinkLabels' | 'arcs' | 'arcLabels' | 'legends' export interface PieCustomLayerProps { - dataWithArc: ComputedDatum[] + dataWithArc: readonly ComputedDatum[] centerX: number centerY: number radius: number @@ -114,7 +114,7 @@ export type CommonPieProps = { isInteractive: boolean tooltip: React.FC> - legends: LegendProps[] + legends: readonly LegendProps[] role: string renderWrapper: boolean @@ -137,7 +137,7 @@ export type PieSvgProps = DataProps & Partial> & SvgDefsAndFill> & PieHandlers & { - layers?: PieLayer[] + layers?: readonly PieLayer[] animate?: boolean motionConfig?: MotionProps['motionConfig'] transitionMode?: ArcTransitionMode @@ -148,7 +148,7 @@ export type CompletePieSvgProps = DataProps & CommonPieProps & SvgDefsAndFill> & PieHandlers & { - layers: PieLayer[] + layers: readonly PieLayer[] animate: boolean motionConfig: MotionProps['motionConfig'] transitionMode: ArcTransitionMode