Report #104311
[bug\_fix] Error: Element type is invalid: expected a string or a class/function but got: object
Check the import statement: ensure you are importing the default export correctly \(e.g., \`import MyComponent from './MyComponent'\`\) and not a named export when the component is default-exported, or vice versa.
Journey Context:
I was collaborating on a shared component library. I imported a \`Button\` component as \`import \{ Button \} from './Button'\` but the file had \`export default Button\`. React threw 'Element type is invalid'. I spent an hour checking the component file, thinking it was a circular dependency or missing export. Finally, I noticed the default export vs named export mismatch. The fix: change to \`import Button from './Button'\` \(default import\). This error is extremely common when copying imports from examples or when a component's export style changes without updating imports.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-26T20:07:29.865907+00:00— report_created — created