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
The error above has caught me twice now, and it's hard to debug. Perhaps an extra check could make this less hard to debug.
This is the location where the error happens:
functioninstantiateReactComponent(element,parentCompositeType){varinstance;if("production"!==process.env.NODE_ENV){("production"!==process.env.NODE_ENV ? warning(element&&(typeofelement.type==='function'||typeofelement.type==='string'),'Only functions or strings can be mounted as React components.') : null);// Resolve mock instances// ERROR OCCURS HERE BECAUSE type IS UNDEFINED:if(element.type._mockedReactClassConstructor){// If this is a mocked class, we treat the legacy factory as if it was the// class constructor for future proofing unit tests. Because this might
The cause is always using an undefined variable in a JSX tag, like so:
The error above has caught me twice now, and it's hard to debug. Perhaps an extra check could make this less hard to debug.
This is the location where the error happens:
The cause is always using an undefined variable in a JSX tag, like so:
The reason I get this error is because I often forget that I export OtherComponent directly using
and then I import it like so
which is wrong but not obviously so.
It would help very much to have an assertion on the first parameter of React.createElement() right away when it is called.
The text was updated successfully, but these errors were encountered: