Uncaught Error: The element you provided cannot be rendered.
See original GitHub issueHi,
I’m having this error after one toast has been shown:
ToastContainer.js:201 Uncaught Error: The element you provided cannot be rendered. You provided an element of type undefined
at ToastContainer.show (ToastContainer.js:201)
at Object.<anonymous> (ToastContainer.js:140)
at EventManager.js:39
In App.js
I do this:
componentWillReceiveProps(nextProps) {
if (nextProps.errorMessage !== '') toast.error(nextProps.errorMessage);
}
and the render:
render() {
const { isAuthenticated } = this.props;
return (
<Fragment>
<ToastContainer position="bottom-right" />
<Geolocation />
<App isAuthenticated={isAuthenticated} />
</Fragment>
);
}
Thanks
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Toast is not rendered (react-toastify component) - Stack Overflow
I just use the sample code from the documentation. Thank you for your help! reactjs · toast · Share.
Read more >Troubleshooting Guide - React Flow
This guide contains warnings and errors that can occur when using React Flow. We are also adding common questions and pitfalls that we...
Read more >Understanding the "Objects are not valid as a react child" Error ...
The "Objects are not valid as a React child" error happens when trying to render a collection of data by mistakenly returning the...
Read more >Refs Must Have Owner Warning - React
You are trying to add a ref to an element that is being created outside of a component's render() function. You have multiple...
Read more >A Guide to Common React Errors
Error : Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null. ... The...
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
I’m getting the same error when ToastContainer is constructed. None of my other code is calling toast.show, but it appears that the show method is being called when the listener for the ACTION.SHOW event is being created. See screenshot. (content is undefined).
The app is running in createReactApp development server, not ejected, with react v.16.5.0, react-scripts v.1.1.5
Hello @albert-olive,
The issue is coming from here I guess:
It looks like
nextProps.errorMessage
is undefined. Could you check it?