From 1a4b871d70d3712d65bba3903f48689da2d79685 Mon Sep 17 00:00:00 2001 From: Joshua Date: Thu, 7 Nov 2024 00:18:56 +0000 Subject: [PATCH] fix(core): allow for actual motionConfig proptypes on (#2653) Co-authored-by: Joshua --- packages/core/src/components/Container.js | 4 ++-- packages/core/src/components/LegacyContainer.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/core/src/components/Container.js b/packages/core/src/components/Container.js index 025cf8fbf9..5b106825da 100644 --- a/packages/core/src/components/Container.js +++ b/packages/core/src/components/Container.js @@ -2,7 +2,7 @@ import { useRef } from 'react' import PropTypes from 'prop-types' import { TooltipProvider, Tooltip } from '@nivo/tooltip' import { ThemeProvider } from '../theming' -import { MotionConfigProvider } from '../motion' +import { MotionConfigProvider, motionPropTypes } from '../motion' import { ConditionalWrapper } from './ConditionalWrapper' const containerStyle = { @@ -43,7 +43,7 @@ Container.propTypes = { renderWrapper: PropTypes.bool, theme: PropTypes.object, animate: PropTypes.bool, - motionConfig: PropTypes.string, + motionConfig: PropTypes.oneOfType([PropTypes.string, motionPropTypes.motionConfig]), } export default Container diff --git a/packages/core/src/components/LegacyContainer.js b/packages/core/src/components/LegacyContainer.js index 5214c42a6d..ecc073e1fa 100644 --- a/packages/core/src/components/LegacyContainer.js +++ b/packages/core/src/components/LegacyContainer.js @@ -8,7 +8,7 @@ import { } from '@nivo/tooltip' import noop from '../lib/noop' import { ThemeProvider } from '../theming' -import { MotionConfigProvider } from '../motion' +import { MotionConfigProvider, motionPropTypes } from '../motion' import { ConditionalWrapper } from './ConditionalWrapper' const containerStyle = { @@ -72,5 +72,5 @@ LegacyContainer.propTypes = { renderWrapper: PropTypes.bool, theme: PropTypes.object.isRequired, animate: PropTypes.bool.isRequired, - motionConfig: PropTypes.string, + motionConfig: PropTypes.oneOfType([PropTypes.string, motionPropTypes.motionConfig]), }