cooperka / react-native-snackbar

:candy: Material Design "Snackbar" component for Android and iOS.
Other
815 stars 150 forks source link

Fix for crash when there's no superview #196

Closed pe-johndpope closed 1 year ago

pe-johndpope commented 2 years ago

fix for crash when there's no superview. (Haven't tested this yet. should work fine as the exception from present will bubble up and be caught)

Fixes #192

cooperka commented 2 years ago

Thanks for the contribution @pe-johndpope -- this change would certainly prevent crashes from being reported, but some more work needs to be done to track down the root cause of the issue and fix it.

Currently, this PR will just disable the snackbar on devices that otherwise would have loudly crashed. That may be acceptable in cases where the snackbar says something simple like "done", but in other cases, app developers are relying on users being able to press an action button inside of the snackbar such as "accept" or "next", and this silent disabling may make them even more confused than a crash.

I will follow up on #192 with some help + a question for you. Thanks for your debugging work so far!

cooperka commented 1 year ago

superceded by #198 -- thanks again @pe-johndpope!