Menu

React.createElement: type is invalid -- expected a string

React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

If you are seeing this error that means you are using any element that is either not imported or not getting resolved in your render.

Resolution 1

Check the elements that are being use and their import.

Resolution 2

Change the return statement and try to return without function sign. refere Stackoverflow | React.createElement: type is invalid -- expected a string


Hope this help you to resolve the error.

No comments:

Post a Comment