Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined
Closed this issue · 7 comments
After including LastConverted component in Home screen, I'm getting this error 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, or you might have mixed up default and named imports
I need two things to help
- What's your
LastConverted
code look like? - What's your import logic look like in
Home
?
I am sharing the GitHub link here
I believe your issue is in Text/index.js
where you have
export default { LastConverted, styles };
it should be
export { LastConverted, styles };
(notice the lack of default
).
That should work!
Hey @spencercarli, thanks for your help! I didn't notice that one
hey @spencercarli I've got this same issue but mine indicates something different:
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, or you might have mixed up default and named imports.
Check the render method of `InputWithButton`.
Hope, you can check the actual state of my components in my repo: https://github.com/cesc1989/currency-converter I am clueless about this.
They're similar (or at least what I understand) to yours.
@cesc1989 can you open up a new issue?
@spencercarli done. Thanks for your help!