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
When customize icon with function like the last example in the doc, Typescript will complain about type mismatched.
For example toast("Wow so easy !", { icon: () => "a" }) would results in this error from
Type '() => string' is not assignable to type 'ReactNode'.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your CodeSandbox (https://codesandbox.io/s/new) example below:
Do you want to request a feature or report a bug?
report a bug 馃悶
What is the current behavior?
When customize icon with function like the last example in the doc, Typescript will complain about type mismatched.
For example
toast("Wow so easy !", { icon: () => "a" })
would results in this error fromIf the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your CodeSandbox (https://codesandbox.io/s/new) example below:
https://codesandbox.io/s/react-toastify-customize-icon-spjxlf?file=/src/App.tsx
What is the expected behavior?
No type error when customize icon with function (the functionality seems to be working as expected)
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
React version 17-18
The text was updated successfully, but these errors were encountered: