Skip to content

Commit

Permalink
fix(pie): pass renderWrapper prop to container
Browse files Browse the repository at this point in the history
  • Loading branch information
wyze committed May 22, 2021
1 parent 7bc4fc7 commit cec89ff
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
12 changes: 8 additions & 4 deletions packages/pie/src/Pie.tsx
Expand Up @@ -232,13 +232,17 @@ export const Pie = <RawDatum,>({
animate = defaultProps.animate,
motionConfig = defaultProps.motionConfig,
theme,
renderWrapper,
...otherProps
}: PieSvgProps<RawDatum>) => (
<Container
isInteractive={isInteractive}
animate={animate}
motionConfig={motionConfig}
theme={theme}
{...{
animate,
isInteractive,
motionConfig,
renderWrapper,
theme,
}}
>
<InnerPie<RawDatum> isInteractive={isInteractive} {...otherProps} />
</Container>
Expand Down
4 changes: 2 additions & 2 deletions packages/pie/src/PieCanvas.tsx
@@ -1,6 +1,5 @@
import React, { createElement, useEffect, useMemo, useRef } from 'react'
import { getRelativeCursor, useDimensions, useTheme, Container } from '@nivo/core'
// @ts-ignore
import { renderLegendToCanvas } from '@nivo/legends'
import { useInheritedColor, InheritedColorConfig } from '@nivo/colors'
import { useTooltip } from '@nivo/tooltip'
Expand Down Expand Up @@ -293,9 +292,10 @@ const InnerPieCanvas = <RawDatum,>({
export const PieCanvas = <RawDatum,>({
isInteractive = defaultProps.isInteractive,
theme,
renderWrapper,
...otherProps
}: PieCanvasProps<RawDatum>) => (
<Container isInteractive={isInteractive} theme={theme}>
<Container {...{ isInteractive, renderWrapper, theme }}>
<InnerPieCanvas<RawDatum> isInteractive={isInteractive} {...otherProps} />
</Container>
)
1 change: 1 addition & 0 deletions packages/pie/src/types.ts
Expand Up @@ -112,6 +112,7 @@ export type CommonPieProps<RawDatum> = {
legends: LegendProps[]

role: string
renderWrapper: boolean
} & Partial<ArcLabelsProps<ComputedDatum<RawDatum>>> &
Partial<ArcLinkLabelsProps<ComputedDatum<RawDatum>>>

Expand Down

0 comments on commit cec89ff

Please sign in to comment.