If you want to change the content it's straightforward as well. You can render any valid element including a react component. Pass your value to a render option as follow:
By default, when you update a toast, there is no transition applied. If you want to apply a transition, it can be done via the className or the transition option:
If you want to inherit props from the ToastContainer, you can reset an option by passing null.
It's particularly useful when you remove the closeButton from a toast and you want it back during the update.
functionExample(){
const toastId = React.useRef(null);
constnotify=()=>{
toastId.current =toast("Hello",{
autoClose:false,
closeButton:false// Remove the closeButton
});
}
constupdate=()=>{
toast.update(toastId.current,{
type: toast.TYPE.INFO,
autoClose:5000,
closeButton:null// The closeButton defined on ToastContainer will be used