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

'@types/hoist-non-react-statics' need to be a dependency #1334

Closed
KnisterPeter opened this issue Apr 23, 2019 · 2 comments · Fixed by #1338
Closed

'@types/hoist-non-react-statics' need to be a dependency #1334

KnisterPeter opened this issue Apr 23, 2019 · 2 comments · Fixed by #1338

Comments

@KnisterPeter
Copy link
Contributor

Describe the bug

$ .../node_modules/.bin/tsc --noEmit
node_modules/react-dnd/lib/cjs/interfaces/classApi.d.ts:5:33 - error TS7016: Could not find a declaration file for module 'hoist-non-react-statics'. '.../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js' implicitly has an 'any' type.
  Try `npm install @types/hoist-non-react-statics` if it exists or add a new declaration (.d.ts) file containing `declare module 'hoist-non-react-statics';`

5 import { NonReactStatics } from 'hoist-non-react-statics';
                                  ~~~~~~~~~~~~~~~~~~~~~~~~~

Since hoist-non-react-statics leaks into the declaration files it need to be a dependeny of this project. Right now its only a dev-dependency and is not installed if react-dnd is added to a project.

@spassvogel
Copy link

I have the same problem...

KnisterPeter added a commit to KnisterPeter/react-dnd that referenced this issue Apr 29, 2019
Since the typings are leaking into the exported d.ts files, the typings
need to be a depenedency to be installed when adding react-dnd as a
dependency to using projects.
Note: devDependencies are not installed on using side

Closes react-dnd#1334
mockdeep pushed a commit to mockdeep/questlog that referenced this issue May 25, 2019
Bumps [react-dnd](https://github.com/react-dnd/react-dnd) from 5.0.0 to 7.4.5.
- [Release notes](https://github.com/react-dnd/react-dnd/releases)
- [Commits](react-dnd/react-dnd@v5.0.0...v7.4.5)

- needed to add due to `@types/hoist-non-react-statics` due to [new
  implicit dependency][1].
- removed `flow`, as it was causing a strange TS error.

[1]: [react-dnd/react-dnd#1334]

Signed-off-by: dependabot[bot] <support@dependabot.com>
mockdeep pushed a commit to mockdeep/questlog that referenced this issue May 25, 2019
Bumps [react-dnd](https://github.com/react-dnd/react-dnd) from 5.0.0 to 7.4.5.
- [Release notes](https://github.com/react-dnd/react-dnd/releases)
- [Commits](react-dnd/react-dnd@v5.0.0...v7.4.5)

- needed to add due to `@types/hoist-non-react-statics` due to [new
  implicit dependency][1].
- removed `flow`, as it was causing a strange TS error.

[1]: [react-dnd/react-dnd#1334]

Signed-off-by: dependabot[bot] <support@dependabot.com>
darthtrevino pushed a commit that referenced this issue May 29, 2019
Since the typings are leaking into the exported d.ts files, the typings
need to be a depenedency to be installed when adding react-dnd as a
dependency to using projects.
Note: devDependencies are not installed on using side

Closes #1334
@leepoong
Copy link

leepoong commented May 2, 2020

Module '"../../../hoist-non-react-statics"' has no exported member 'NonReactStatics'. Did you mean to use 'import NonReactStatics from

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 a pull request may close this issue.

3 participants