Skip to content

Commit

Permalink
fix: use motion.create instead of motion()
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Dec 9, 2024
1 parent 89107fe commit 8c3fb11
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/core/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Transition, Variant} from 'framer-motion'
import type {Transition, Variant} from 'framer-motion'

/**
* @internal
Expand Down
4 changes: 2 additions & 2 deletions src/core/primitives/popover/popoverCard.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Strategy} from '@floating-ui/react-dom'
import {ThemeColorSchemeKey} from '@sanity/ui/theme'
import {MotionProps, motion} from 'framer-motion'
import {type MotionProps, motion} from 'framer-motion'
import React, {CSSProperties, forwardRef, memo, useMemo} from 'react'
import {styled} from 'styled-components'
import {POPOVER_MOTION_CONTENT_OPACITY_PROPERTY, POPOVER_MOTION_PROPS} from '../../constants'
Expand All @@ -15,7 +15,7 @@ import {
DEFAULT_POPOVER_MARGINS,
} from './constants'

const MotionCard = styled(motion(Card))`
const MotionCard = styled(motion.create(Card))`
&:not([hidden]) {
display: flex;
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/primitives/tooltip/tooltipCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {ThemeColorSchemeKey} from '@sanity/ui/theme'
import {MotionProps, motion} from 'framer-motion'
import {type MotionProps, motion} from 'framer-motion'
import React, {CSSProperties, forwardRef, memo, useMemo} from 'react'
import {styled} from 'styled-components'
import {POPOVER_MOTION_CONTENT_OPACITY_PROPERTY, POPOVER_MOTION_PROPS} from '../../constants'
Expand All @@ -12,7 +12,7 @@ import {
DEFAULT_TOOLTIP_ARROW_WIDTH,
} from './constants'

const MotionCard = styled(motion(Card))`
const MotionCard = styled(motion.create(Card))`
& > * {
opacity: var(${POPOVER_MOTION_CONTENT_OPACITY_PROPERTY}, 1);
will-change: opacity;
Expand Down

0 comments on commit 8c3fb11

Please sign in to comment.