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
Warning: React.createElement: type should not be null, undefined, boolean, or number. It should be a string (for DOM elements) or a ReactClass (for composite components).
It would be more helpful if the warning actually said what value was passed, e.g.:
Warning: React.createElement: 5 is an invalid value for type. It should be a string (for DOM elements) or a ReactClass (for composite components).
The text was updated successfully, but these errors were encountered:
Thanks for the issue @Wilfred! We agree that the message is lacking, and as luck would have it we're already tracking this in #7307. There's a PR open (#7402) to improve the message by linking to a more descriptive doc, and I think we're going to try to include this kind of info in the warning as well if we can.
I'm going to close this as duplicate, so feel free to subscribe to #7307 and #7402 and provide input there.
IMO Not sure it will help that much to print the actual value. Most cases when I hit this error or get questions about it, it's mostly caused by undefined because of a faulty component require/export.
Ideally I would like it to log in which component the error occurred and also maybe point out that if the value is undefined tell you to check your component requires/exports.
If the value isn't undefined then it may be nice to log the value.
Currently,
createElement
throws the warning:It would be more helpful if the warning actually said what value was passed, e.g.:
The text was updated successfully, but these errors were encountered: