Warning: React does not recognize the `closeToast` on using custom css classes
See original GitHub issueHello,
I’m using custom css classes in my web-app to style the default toastr message. The resultant toastr message looks like this:
and I am using the following code to display a toastr and everything works well.
toast.success(
We have successfully updated your preference., { className: "toasterSuccess", });
But, React throws me this warning whenever a toastr message is displayed on the screen:
Warning: React does not recognize the closeToast
prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase closetoast
instead. If you accidentally passed it from a parent component, remove it from the DOM element.
Can someone help me in suppressing these warnings?
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
React does not recognize the X prop on a DOM element ...
[Error] Warning: React does not recognize the isSignedIn prop on a DOM element. If you intentionally want it to appear in the DOM...
Read more >react-toastify - npm
Start using react-toastify in your project by running `npm i ... using a custom close button, the component will receive a prop closeToast...
Read more >Unknown Prop Warning - React
The unknown-prop warning will fire if you attempt to render a DOM element with a prop that is not recognized by React as...
Read more >View Raw - UNPKG
BOTTOM_CENTER }); toast("Custom Style Notification with css class! ... import { ToastContainer } from 'react-toastify'; // close toast after 8 seconds const ...
Read more >@repetere/react-toastify - npm package | Snyk
Easy to setup for real, you can make it work in less than 10sec! Super easy to customize; RTL support; Swipe to close;...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If anyone still doesnt understand the solution, all you have to do that create a React element as a wrapper for toastContent.
Old Code
New Code
What’s the answer to this error? I am getting it but I haven’t used any closeButton or closeToast prop.