I am getting a really weird error when sending a toast in an async event handler (onClick).
Error: Objects are not valid as a React child (found: object with keys {code, message, stack}). If you meant to render a collection of children, use an array instead.
in div (created by a)
in a
in div (created by ForwardRef(a))
in ForwardRef(a)
in Unknown (created by Toaster)
in div (created by Toaster)
in div (created by Toaster)
in Toaster (at App.tsx:56)
in Router (created by BrowserRouter)
in BrowserRouter (at App.tsx:34)
It looks like you are trying to render an error object, which is not a valid React child.
You would need to convert it to a string or just use toast.error(error.message).
Hey!
I am getting a really weird error when sending a toast in an async event handler (onClick).