-
Notifications
You must be signed in to change notification settings - Fork 47k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncaught Invariant Violation: Element 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. #9249
Comments
It looks like you're importing your To fix this, change the 3rd line of import App, {Home} from './Forms.jsx'; , and that should work. |
Yep, that's the problem. |
Great ... took me 4 hours to find out and fixed in a second after landed here ... |
@malikgenius - haha I feel you. This is one of those things that you spend a ton of time figuring out the first time, and then you know how to fix it forever. A note though - React provides some really good error messages, so it helps to read them thoroughly. |
Yeah :-) the message pretty much says this:
|
I guess we could amend and add something like "or you might have mistaken default and named imports". |
On it @gaearon :) |
Hey @selbekk In my App.js , I have the following code :
This is very similar to https://facebook.github.io/react-native/docs/tutorial.html and I don't see what I am not sure what I am exporting/importing incorrectly . Thank you :) |
Can’t see anything wrong with that code tbh. |
I’ll lock this issue because any similar problems are not necessarily related to the particular problem this issue is describing, and closed issues don’t usually get responses. Please file a new issue if you experience a problem, along with a reproducing project. |
Do you want to request a feature or report a bug?
I think this is most probably is a Bug
index.js:946 Uncaught Invariant Violation: Element 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.
How ever i have exported All component properly
// Forms.js
//main.js
The text was updated successfully, but these errors were encountered: