Use a custom id
A custom toastId
can be used to replace the one generated. You can provide a number
or a string
.
import { toast } from 'react-toastify';
function Example(){
const notify = () => {
toast("I use a custom id", {
toastId: "customId"
});
}
return (<button onClick={notify}>Notify</button>);
}