On 0.62.2 onDismiss functions were called on modals being closed. After upgrading to 0.63.0, onDimiss functions are no longer called. This was working fine before upgrading from 62.2 to 63.
Provide a detailed list of steps that reproduce the issue.
onDimiss function should be called
| :warning: | Missing Environment Information |
|---|---|
| :information_source: | Your issue may be missing information about your development environment. You can obtain the missing information by running react-native info in a console. |
Realize that 0.63 is new enough that you can't repro in a Snack, but it would help if you pointed to a Snack that shows this working pre-0.63.
| :warning: | Missing Reproducible Example |
|---|---|
| :information_source: | It looks like your issue is missing a reproducible example. Please provide a Snack or a repository that demonstrates the issue you are reporting in a minimal, complete, and reproducible manner. |
@chrisglein I made an example using Expo SDK 38.0.0, which shows that the behavior is correct in RN 0.62 https://snack.expo.io/@srpoder/excited-cheese
Also the RN Documentation specifies that onDismiss should be available on RN 0.63 https://reactnative.dev/docs/modal#ondismiss
+1 onDismiss not called and not open second modal when i have closed fist modal and open second modal
Same issue, i upgraded to 0.63 and now when i set the modal visible to false, it don't invoke onDismiss, but when i close the modal of react native navigation, it surprisingly invoke onDismiss, but i don't need when i close the modal of react native navigation. But i need as usual, invoked when i set to false the visible of react native modal.
Steps:
This fix in RN 0.62.1 doesn't seem to be in RN 0.63.
Is this the cause?
https://github.com/facebook/react-native/commit/27a3248a3b37410b5ee6dda421ae00fa485b525c
We're seeing the same behavior. The onDismiss callback is never called when hiding the modal. I can also confirm the behavior as explained by @diolegend.
In case it helps - I cannot seem to get onDismiss to ever fire on the docs example expo snack using Android either.
Both onDismiss and onHideModal not working for me, tried using the expo snack and also did not work
Workaround is to use onSwipeComplete and onBackdropPress and add callbacks followed by toggle function
still have this issue with react native 0.63.3
Most helpful comment
Same issue, i upgraded to 0.63 and now when i set the modal visible to false, it don't invoke onDismiss, but when i close the modal of react native navigation, it surprisingly invoke onDismiss, but i don't need when i close the modal of react native navigation. But i need as usual, invoked when i set to false the visible of react native modal.
Steps: