Skip to content
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

TypeScript import error: You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports. #224

Closed
Amaimersion opened this issue Aug 3, 2019 · 3 comments
Labels
question Further information is requested

Comments

@Amaimersion
Copy link

I'm using TypeScript and doing following import:

import Calendar from "react-calendar";
...
render() {
  <Calendar />
}

And i get following error: Uncaught Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Here is a screenshot from developer console (don't pay attention to react-loadable)
1

For example, using of MonthView works fine. But entire default module not working.

TypeScript version – 3.5.3
React version – 16.8.6
React Calendar version – 2.19.0

@wojtekmaj wojtekmaj added help wanted Extra attention is needed question Further information is requested labels Aug 5, 2019
@tejovanthWork
Copy link

Hey @Amaimersion, can you post some repo with this bug? I'm unable to reproduce this issue with the same versions.

@wojtekmaj
Copy link
Owner

Closed because of #273

@wojtekmaj wojtekmaj removed the help wanted Extra attention is needed label Mar 24, 2023
@wojtekmaj
Copy link
Owner

FYI, React-Calendar is now natively in TypeScript, as of #785, coming to npm very soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants