React-toastify: Warning: React does not recognize the `closeToast` on using custom css classes

Created on 22 Aug 2018  路  5Comments  路  Source: fkhadra/react-toastify

Hello,

I'm using custom css classes in my web-app to style the default toastr message. The resultant toastr message looks like this:

toastr-screenshot

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?

Most helpful comment

What's the answer to this error? I am getting it but I haven't used any closeButton or closeToast prop.

All 5 comments

Hello @caype,

Could you share a code snippet on codesanbox for instance.

Which version of react are you using ?

Thanks

Hey @fkhadra ,

I'm using React 16.3.2. you can find the behaviour in this sandbox.

screenshot of the error on codesandbox.io:

image

Thanks in Advance.

I understood what's going wrong. Instead of implementing a component for the closeButton prop, I'm directly passing in an Image tag for that prop.

Thanks again for the library 馃憤

@caype I was about to answer. I'm glad you solved the issue.

Thanks again for the library 馃憤

My pleasure 馃榿

What's the answer to this error? I am getting it but I haven't used any closeButton or closeToast prop.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

giocodes picture giocodes  路  3Comments

prmichaelsen picture prmichaelsen  路  5Comments

shirbr510 picture shirbr510  路  5Comments

NoMercy235 picture NoMercy235  路  5Comments

tobiasfriden picture tobiasfriden  路  3Comments