motion icon indicating copy to clipboard operation
motion copied to clipboard

refactor(types): Make BezierDefinition readonly for improved usability

Open SaeWooKKang opened this issue 1 year ago • 0 comments

fixed #2653

Hello. It seems that changing the currently written tuple type to a readonly type would make it more convenient to use.

If any modifications are needed, please let me know.

AS-IS

import { animate } from 'framer-motion'

// this works
animate(someElement, { rotateY: '180deg' }, { ease: [0.3, 1, 0, 1] })

// this throws type error
const e = [0.3, 1, 0, 1] as const
animate(someElement, { rotateY: '180deg' }, { ease: e })

TO-BE

import { animate } from 'framer-motion'

// this works
animate(someElement, { rotateY: '180deg' }, { ease: [0.3, 1, 0, 1] })

// this also works
const e = [0.3, 1, 0, 1] as const
animate(someElement, { rotateY: '180deg' }, { ease: e })

SaeWooKKang avatar Sep 29 '24 06:09 SaeWooKKang