You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was thinking that the following API would be nice to allow users to default to a certain toast message if none is provided:
// example API<Toastertypes=[{icon: ErrorIcon,defaultMessage: 'An error happened'}]// in this way one could do the followingtoast.error()// An alternative to this would be to wrap the `toast` object and export it in your application, e.g.import{toastastoastHander}from'react-hot-toast'exportconsttoast={
...toastHandler,error: (message,opts)=>toastHandler.error(message||'Your default error message',opts)}
What do you think?
The text was updated successfully, but these errors were encountered:
tobiasbueschel
changed the title
Add ability to customise default messages
Add ability to customise default toast messages
Feb 9, 2021
Hi @timolins 👋
I was thinking that the following API would be nice to allow users to default to a certain toast message if none is provided:
What do you think?
The text was updated successfully, but these errors were encountered: