Hey,
Getting this warning when using toast:
Warning: Unknown propcloseToaston <div> tag. Remove this prop from the element. For details, see https://fb.me/react-unknown-prop
This is my usage (styling and content text simplified):
import { toast } from 'react-toastify';
export const successToast = () => toast(
<div>
<span>Completed successfully</span>
</div>,
{
autoClose: 5000,
type: 'success'
}
);
Edit:
Made a small workaround to avoid this warning (still should be fixed though):
const Container = (props) => <div>{props.children}</div>;
export const successToast = () => toast(
<Container>
<div>
<span>Completed successfully</span>
</div>
</Container>,
{
autoClose: 5000,
type: 'success'
}
);
Hello @nirsky,
What's going on with your first snippet is that you try to assign a prop to an html node instead of a react component.
But you're right i'll create a dumb container in case i don't receive a react element.
I'll fix it tonight.
Thank for the input !
@fkhadra Thanks, keep up the good job! Great package, really easy to use.
Hey @nirsky v1.4.2 is live with the fix.
Thanks
Most helpful comment
Hello @nirsky,
What's going on with your first snippet is that you try to assign a prop to an html node instead of a react component.
But you're right i'll create a dumb container in case i don't receive a react element.
I'll fix it tonight.
Thank for the input !