Re:Speeding up Unreal Editor launch by not spawning 38000 to...
by jitl on Sunday September 07, 2025 @11:58PM
(#45164508)
For anyone curious, here's a proof-of-concept of how to implement a <Modal> that manages its own transition out when it's unmounted using just ReactDOM.createPortal and React.useLayoutEffect.
https://stackblitz.com/edit/react-modal-with-transition-out?...
There are many high quality third party tools to help with this, such as Motion’s <AnimatePresence> (https://motion.dev/docs/react-animate-presence). I haven’t used the library you mentioned, but it seems somewhat unmaintained and isn’t compatible with react-dom@19.
First party support is coming to React with the new <ViewTransition> component (https://react.dev/reference/react/ViewTransition).
If you insist that only the React maintainers are allowed to diverge DOM state from the render tree or write code you don’t understand, you can adopt it today from react{,-dom}@experimental. It’s been available there since April (https://react.dev/blog/2025/04/23/react-labs-view-transition...).