cooperka / react-native-snackbar

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

Does not work from inside an async generator? #160

Closed ospfranco closed 3 years ago

ospfranco commented 3 years ago

Hey, I was facing the issue when attaching to a parent that gets dismissed, so when I call the snackbar from a setTimeout everything works fine, but when I try to call it inside a async generator (redux saga in this case), it explodes:

87920609-bda85280-ca79-11ea-9812-43d2d6dc241f

I have a suspicion that this has to do with the fact that setTimeout is an API that runs on the event loop and generators are language level constructs

cooperka commented 3 years ago

To be clear, is this a setTimeout within an async generator that's not working? A working demo app would be super helpful if you're able to provide it.

ospfranco commented 3 years ago

Hi @cooperka, thanks for answering, I just tested this again and it seems it was a problem with the generator itself, but rather the time that the call was delayed, increasing the time gets rid of the error and allows the snack show properly, thanks!