Temzasse / react-modal-sheet

Flexible bottom sheet component built with Framer Motion to provide buttery smooth UX while keeping accessibility in mind 🪐
https://temzasse.github.io/react-modal-sheet/
MIT License
815 stars 77 forks source link

Typescript Implementation Issue #4

Closed franziz closed 3 years ago

franziz commented 3 years ago

Hi, I am really love your work for this react-modal-sheet. However, I face implementation issue. Would be great if you can take a look.

I know you are busy with your job, any help will be appreciated.

Typescript implementation with "react-modal-sheet": "^0.1.3",

Type '{}' is missing the following properties from type 'Pick<MotionProps, "inherit" | "transition" | "style" | "static" | "drag" | "onDrag" | "onDragEnd" | "onDragStart" | "onAnimationStart" | "transformTemplate" | "transformValues" | ... 31 more ... | "custom">': static, positionTransition, layoutTransition, _dragValueX, and 4 more.

    17 |       <Sheet isOpen={true} onClose={() => {}}>
  > 18 |         <Sheet.Backdrop />
       |          ^
    19 |       </Sheet>

Any idea for this issue?

Thanks

Temzasse commented 3 years ago

Thank you for reporting this!

What versions are you using for framer-motion and typescript?

franziz commented 3 years ago
"typescript": "~3.7.2",
"framer-motion": "^2.9.4",

I think mostly is because the frame-motion version. You are using 1.11.0. It introduces breaking changes

Thanks for replying in such a fast time. Keep safe :D

franziz commented 3 years ago

Just to update as well. It works on frame-motion: 1.11.0

Temzasse commented 3 years ago

Thanks for the details!

I have trouble reproducing this locally 🤔

However, I think I will just drop the support for framer-motion v1 and release a new version that only supports framer-motion v2. Hopefully that will fix this issue 🤞

Temzasse commented 3 years ago

@franziz I just released 1.0.0 that now only supports framer-motion v2 🚀

I checked that at least on Codesandbox the new types seem to work fine now. Hopefully it works for you too!

franziz commented 3 years ago

It works in your 1.0.0 release!

Great! Thanks.

smontlouis commented 3 years ago

Hi, I have this issue with: