eBay / nice-modal-react

A modal state manager for React.
https://ebay.github.io/nice-modal-react
MIT License
1.96k stars 110 forks source link

MUI v5 onExited not supported #30

Closed nuurcodes closed 2 years ago

nuurcodes commented 2 years ago

I am using the muiDialog helper in MUI v5

e.g. <Dialog {...muiDialog(modal)}>...</Dialog>

This issue with this is that the onExited property is not supported which means that modal.remove() is never called.

This is my workaround but it would be great if this handled in the library instead

` <Dialog {...muiDialog(modal)} TransitionProps={{ onExited: () => { modal.resolveHide() modal.remove() } }}

`

supnate commented 2 years ago

Thanks @nuurcodes for reporting this!

supnate commented 2 years ago

Since onExited is under TransitionProps prop, we can't create a helper for nested props. It needs to be configured manually for Mui: https://ebay.github.io/nice-modal-react/#mui