Toast with Ionic React
A toast notification is a long standing custom in mobile application used to notify the user of something happening within the system. Sometimes it even has buttons for interaction.

Here is how to use one (straight from the docs):
Well, this is easy 😁I can do that.
But I normally thinks of toasts more imperatively than this. It might be because of libraries like react-toast or ant.design who have these imperative toast messaging systems, or it could even be that Ionic's own Angular part of design has an imperative toast.
Also, if I needed to a success toast and an error toast, I would need multiple IonToast components rendered or have states definining toast state.
In Angular Ionic, you would:
That's pretty cool 😎. What if we could do this?
We could utilise a React Context and a hook to achieve this functionality at with ease. I wrote out a custom package which does exactly that.
This allows you have to have error messages with a one liner:
The ToastProvider also takes a value property that allows you to define defaults for all toasts created in it's children.
The package also enables creating toast messages with the same Angular API as:
To install the package:
Note that it has a dependency on both React and Ionic React.