Skip to content

Commit cec89ff

Browse files
committed
fix(pie): pass renderWrapper prop to container
1 parent 7bc4fc7 commit cec89ff

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

packages/pie/src/Pie.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,17 @@ export const Pie = <RawDatum,>({
232232
animate = defaultProps.animate,
233233
motionConfig = defaultProps.motionConfig,
234234
theme,
235+
renderWrapper,
235236
...otherProps
236237
}: PieSvgProps<RawDatum>) => (
237238
<Container
238-
isInteractive={isInteractive}
239-
animate={animate}
240-
motionConfig={motionConfig}
241-
theme={theme}
239+
{...{
240+
animate,
241+
isInteractive,
242+
motionConfig,
243+
renderWrapper,
244+
theme,
245+
}}
242246
>
243247
<InnerPie<RawDatum> isInteractive={isInteractive} {...otherProps} />
244248
</Container>

packages/pie/src/PieCanvas.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React, { createElement, useEffect, useMemo, useRef } from 'react'
22
import { getRelativeCursor, useDimensions, useTheme, Container } from '@nivo/core'
3-
// @ts-ignore
43
import { renderLegendToCanvas } from '@nivo/legends'
54
import { useInheritedColor, InheritedColorConfig } from '@nivo/colors'
65
import { useTooltip } from '@nivo/tooltip'
@@ -293,9 +292,10 @@ const InnerPieCanvas = <RawDatum,>({
293292
export const PieCanvas = <RawDatum,>({
294293
isInteractive = defaultProps.isInteractive,
295294
theme,
295+
renderWrapper,
296296
...otherProps
297297
}: PieCanvasProps<RawDatum>) => (
298-
<Container isInteractive={isInteractive} theme={theme}>
298+
<Container {...{ isInteractive, renderWrapper, theme }}>
299299
<InnerPieCanvas<RawDatum> isInteractive={isInteractive} {...otherProps} />
300300
</Container>
301301
)

packages/pie/src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ export type CommonPieProps<RawDatum> = {
112112
legends: LegendProps[]
113113

114114
role: string
115+
renderWrapper: boolean
115116
} & Partial<ArcLabelsProps<ComputedDatum<RawDatum>>> &
116117
Partial<ArcLinkLabelsProps<ComputedDatum<RawDatum>>>
117118

0 commit comments

Comments
 (0)