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

Broken Typescript definitions? #269

Closed
fqlx opened this issue Jul 17, 2018 · 2 comments
Closed

Broken Typescript definitions? #269

fqlx opened this issue Jul 17, 2018 · 2 comments
Labels

Comments

@fqlx
Copy link

fqlx commented Jul 17, 2018

Version: 8.0.3
When importing react-waypoint as import Waypoint as 'react-waypoint' my tests error with:

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.

However, if I try to import as:
import * as Waypoint from 'react-waypoint'

Typescript will complain:
TS2604: JSX element type 'Waypoint' does not have any construct or call signatures.

The workaround I've found is to use 7.3.4 which allows me to import * as Waypoint from 'react-waypoint' and my tests pass.

Are the typescript definitions broken?

@MatthewHerbst
Copy link
Contributor

Might be related to #238

@nucleartux
Copy link
Contributor

You should do "import { Waypoint} from 'react-waypoint';".
I think this issue can be closed.
cc @lencioni / @trotzig

@lencioni lencioni closed this as completed Mar 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants