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

TS declaration file is incorrect #34

Merged
merged 1 commit into from
Jul 24, 2017
Merged

Conversation

garbles
Copy link
Contributor

@garbles garbles commented Jul 21, 2017

hoist-non-react-statics does not have a default export and therefore saying import hoistStatics from 'hoist-non-react-statics'; raises an exception in TS 2.4.1. Because you're using module.exports the correct away to require this package in TS is to say import hoistStatics = require('hoist-non-react-statics'); but that means that the declaration file is incorrect.

Possible fixes:

  1. The change proposed here
  2. Change the start of this line to exports.default = modules.exports = ... and leave the declaration file as it is.

hoist-non-react-statics does not have a default export and therefore saying `import hoistStatics from 'hoist-non-react-statics';` raises an expection. Because you're using `module.exports` the correct away to require this package in TS is to say `import hoistStatics = require('hoist-non-react-statics');` but that means that the declaration file is incorrect.

Possible fixes:

1. This change
2. Change the start of [this line](https://github.com/mridgway/hoist-non-react-statics/blob/master/index.js#L35) to `exports.default = modules.exports = ...`
@mridgway mridgway merged commit bddd50b into mridgway:master Jul 24, 2017
@mridgway
Copy link
Owner

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants