Reach-ui: [Dialog] Modal animation

Created on 30 Apr 2020  路  3Comments  路  Source: reach/reach-ui

鉂換uestion

How can i animate unmount of Dialog component? I know about react-spring in the docs, but i want to use more lightweight solution

I was trying to animate it like this:
https://codesandbox.io/s/csstransition-component-mi7p3?file=/index.js
but, no luck

https://dev.to/michalczaplinski/super-easy-react-mount-unmount-animations-with-hooks-4foj

Stale Question

Most helpful comment

I have worked on this! Here's an example with react-spring.

I think you're better off using something like react-spring or framer-motion which does the heavylifting and nastyness such as deferred unmounting for ya. They don't weight _that_ much in my experience. react-spring is just ~10kB minified and gzipped, and it can satisfy all of your animation needs!

All 3 comments

Animating components as they unmount without hacking around the rendering logic is tricky indeed, that's why we typically recommend tools like react-spring that handle that for you. I haven't done this myself but I'll leave the issue open in case anyone else wants to weigh in with alternate methods.

I have worked on this! Here's an example with react-spring.

I think you're better off using something like react-spring or framer-motion which does the heavylifting and nastyness such as deferred unmounting for ya. They don't weight _that_ much in my experience. react-spring is just ~10kB minified and gzipped, and it can satisfy all of your animation needs!

@chancestrickland @raunofreiberg what do you think about this? https://codesandbox.io/s/usedelayunmount-custom-hook-lenni?file=/src/index.tsx

Was this page helpful?
0 / 5 - 0 ratings

Related issues

raunofreiberg picture raunofreiberg  路  3Comments

lawnchamp picture lawnchamp  路  3Comments

CodingDive picture CodingDive  路  6Comments

rumsky picture rumsky  路  6Comments

gdsrosa picture gdsrosa  路  3Comments