Skip to content

Commit 1a4b871

Browse files
Josh-a-eJoshua
and
Joshua
authored
fix(core): allow for actual motionConfig proptypes on <Container /> (#2653)
Co-authored-by: Joshua <[email protected]>
1 parent 7ed3ae0 commit 1a4b871

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/core/src/components/Container.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useRef } from 'react'
22
import PropTypes from 'prop-types'
33
import { TooltipProvider, Tooltip } from '@nivo/tooltip'
44
import { ThemeProvider } from '../theming'
5-
import { MotionConfigProvider } from '../motion'
5+
import { MotionConfigProvider, motionPropTypes } from '../motion'
66
import { ConditionalWrapper } from './ConditionalWrapper'
77

88
const containerStyle = {
@@ -43,7 +43,7 @@ Container.propTypes = {
4343
renderWrapper: PropTypes.bool,
4444
theme: PropTypes.object,
4545
animate: PropTypes.bool,
46-
motionConfig: PropTypes.string,
46+
motionConfig: PropTypes.oneOfType([PropTypes.string, motionPropTypes.motionConfig]),
4747
}
4848

4949
export default Container

packages/core/src/components/LegacyContainer.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
} from '@nivo/tooltip'
99
import noop from '../lib/noop'
1010
import { ThemeProvider } from '../theming'
11-
import { MotionConfigProvider } from '../motion'
11+
import { MotionConfigProvider, motionPropTypes } from '../motion'
1212
import { ConditionalWrapper } from './ConditionalWrapper'
1313

1414
const containerStyle = {
@@ -72,5 +72,5 @@ LegacyContainer.propTypes = {
7272
renderWrapper: PropTypes.bool,
7373
theme: PropTypes.object.isRequired,
7474
animate: PropTypes.bool.isRequired,
75-
motionConfig: PropTypes.string,
75+
motionConfig: PropTypes.oneOfType([PropTypes.string, motionPropTypes.motionConfig]),
7676
}

0 commit comments

Comments
 (0)