From ad2785291983188e8c2a377b62f0f6bb9958e4a5 Mon Sep 17 00:00:00 2001 From: Joshua Date: Thu, 26 Sep 2024 17:59:01 +0100 Subject: [PATCH] allow for actual motionConfig proptypes on --- 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 025cf8fbf..5b106825d 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 5214c42a6..ecc073e1f 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]), }