remobile / react-native-toast

A android like toast for android and ios, android use native toast, ios use UIView+Toast
MIT License
346 stars 143 forks source link

Toast not showing on iPhone if trigger right after a navigate #40

Open AuroreM opened 6 years ago

AuroreM commented 6 years ago

Hi,

In our project we use react-navigation and we want to display a toast after a a page change. We first set a delay of 200ms to wait for the user to be on the new page but it was not working and we were forced to wait for 1s.

Here is a part of our saga :

yield put(
      NavigationActions.reset({
        index: 0,
        actions: [NavigationActions.reset({ routeName: 'getStarted' })],
        key: null,
      })
    );
    yield put(setLoading('saveAndExit', false));
    yield call(delay, 1000);
    Toast.showLongBottom(I18n.t('saveAndExitModal.successToast'));

We think it's because it's conflicting with the animation of the page change. Do you have a clue on how to fix this ?

(It's working well on Android with 200ms)

thanks

guopeng1994 commented 6 years ago

same problem!!!