calintamas / react-native-toast-message

Animated toast message component for React Native
MIT License
1.6k stars 252 forks source link

It is strongly required that each toast can use a separate instance to show or hide #380

Open RocCaiy23 opened 2 years ago

RocCaiy23 commented 2 years ago

I added a toast to each page. When switching pages after calling Toast.show() or Toast.hide() for a long time, it often acts on the toast of the previous page. This is a bug. solve?

ntrabue commented 1 year ago

Is there a reason you need a separate Toast component on every page? I have one Toast component in my App.tsx and one in my ModalScreen.tsx since they are on separate view layers but the Toast.show() args essentially give you infinite flexibility with regards to what is shown and how the toast looks.

alainib commented 8 months ago

@ntrabue how to do target which one to open please ?

landabaso commented 6 months ago

I'd also like to have this. I use Toasts to display errors. I have a Toast component on the Root and another one in a Modal. The toast get's randomly rendered in the App when trying to show it in the Modal. I believe this happens when the Toast has been triggered and not dismissed in the App while the Modal is being mounted. It's difficult to know why this happens, may be another reason.