calintamas / react-native-toast-message

Animated toast message component for React Native
MIT License
1.66k stars 258 forks source link

Add callback to static `Toast.hide()` function #404

Open go-sean-go opened 2 years ago

go-sean-go commented 2 years ago

Is your feature request related to a problem? Please describe. I have a situation where a custom Toast component is shown by a parent view (it performs long-running work), and that custom component is itself responsible for dismissing itself. This works fine, but currently there is no way for the

Describe the solution you'd like Toast.hide() should accept a callback that fires after the Toast is hidden/off-screen (presumably at the same time as the onHide() prop).

Describe alternatives you've considered I was unable to properly pass props to handle this case. React Context may have been another way to go, but this seems silly given the Toast architecture.

Additional context n/a