Definitelytyped: [@types/react-redux] 'hoist-non-react-statics' has no exported member 'NonReactStatics'

Created on 7 Mar 2019  ·  84Comments  ·  Source: DefinitelyTyped/DefinitelyTyped

  • [x] I tried using the @types/react-redux package and had problems.
  • [x] I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript
  • [x] I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).
  • [x] [Mention](https://github.com/blog/821-mention-somebody-they-re-notified) the authors (see Definitions by: in index.d.ts) so they can respond.

@jamesreggio @JounQin

updating from @types/react-redux 7.0.1 to @types/react-redux 7.0.2 gives the following error:

'/node_modules/hoist-non-react-statics' has no exported member 'NonReactStatics'.

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

seems like it was introduced here: https://github.com/DefinitelyTyped/DefinitelyTyped/commit/8b1beff944f6c7bf913b6fcee31fb5f7129064a7

Most helpful comment

I could be wrong but I think the problem is maybe more simple,

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

should be

import NonReactStatics from 'hoist-non-react-statics';

downgrading to @types/react-redux 7.0.1 is a quick fix until this is fixed.

All 84 comments

Yikes. I introduced a dependency upon @types/hoist-non-react-statics in that change, but I didn't add it as a dependency. This problem is, I'm not sure where to declare it as a dependency, since the types only depend upon the types.

@JounQin, can you help me to understand how to fix this. Do we need to add an ///<reference or add something to the package.json?

As a temporary workaround, you can npm install --dev @types/hoist-non-react-statics to your project.

I could be wrong but I think the problem is maybe more simple,

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

should be

import NonReactStatics from 'hoist-non-react-statics';

downgrading to @types/react-redux 7.0.1 is a quick fix until this is fixed.

I got this issue today too. Downgrading to 7.0.1 helped

Same here.

Yikes. I introduced a dependency upon @types/hoist-non-react-statics in that change, but I didn't add it as a dependency

DefinitelyTyped automatically added @types/hoist-non-react-statics as a dependency to @types/react-redux, but (apparently) that wasn't enough for your typings to work.

As a temporary workaround, you can npm install --dev @types/hoist-non-react-statics to your project.

No, that will not work as this dependency is already automatically added by DefinitelyTyped, but it's not enough for TS to treat your typings correctly.

I guess the problem that TS is not aware of the existence of hoist-non-react-statics module, as hoist-react-statics package itself is not present in node_modules (it's a shame that TS cannot derive module existince from @types/hoist-non-react-statics package, although there may be a valid reason for such behaviour e.g. compatibility). This hypothesis is confirmed by the fact that manual installation of hoist-non-react-statics does make your typings work correctly.

So, @jamesreggio I guess you have to add hoist-non-react-statics package as a dependency to the package.json of @types/react-redux in order to fix this issue.

@surgeboris updated to 7.0.3 and added [email protected] and @types/[email protected], fixed an issue

The fix not really working for me. Maybe I am doing something wrong. Using yarn 1.13

Okay everybody, thanks for your patience.

I figured out a fix and opened a PR: #33919.

Apparently, if you use the Node-style type definition export (with export =), the proper way to import is with import [name] = require([package name]). I'm rather unfamiliar with the nuances of these import/export patterns, and I'm only vaguely more confident that I understand it now 😆

Hopefully the maintainers of DefinitielyTyped can get this merged and released ASAP. Sorry again for the regression.

Unfortunately, even with 7.0.4 that was recently released, this hasn't fixed the problem for me

It looks like the explicit dependency on @types/hoist-non-react-statics is still missing.

actually, no - a fresh npm i @types/react-redux installed @types/hoist-non-react-statics. I don't see any problem?

Yup, the dependency is definitely listed in its package.json:

  "dependencies": {
    "@types/hoist-non-react-statics": "*",
    "@types/react": "*",
    "redux": "^4.0.0"
  },

if y'all still having issues, you should double check the right versions of everything have been installed.

(Specifically, the dependency is listed as *, so you may have an older version of @types/hoist-non-react-statics that is maybe missing the type which npm counts as satisfying the dependency?)

So, the problem is somewhat nuanced.

The hoist-non-react-statics package included its own hyper-basic typings from v2.2.0 until v3.0.0, and if the version of hoist-non-react-statics that resolves in your project root in in that range, you'll encounter this error since the package-local typings take precedence over @types/hoist-non-react-statics.

There are two immediate workarounds:

  1. Add hoist-non-react-statics@^3.3.0 to your project as a dependency.
  2. If using yarn, add a resolution override to your package.json as such:
    "resolutions": { "hoist-non-react-statics": "^3.3.0" }

Neither of these are optimal, because most devs are (rightfully) not aware of the existence of hoist-non-react-statics in the first place.

I'm not really sure what the optimal approach would be here, but I suspect that if we could list a specific versionspec for @types/hoist-non-react-statics inside of the package.json for @types/react-redux, we could mitigate the impact.

@weswigham — do you know if its possible to replace the autogenerated dependency with * with a dependency upon @types/hoist-non-react-statics with >=3.3.0?

@weswigham — do you know if its possible to replace the autogenerated dependency with * with a dependency upon @types/hoist-non-react-statics with >=3.3.0?

If you explicitly add it in the package.json it might work? AFAIK you can't hardcode versions for implied or path-mapping based dependencies, but i could be wrong.

@sandersn know anything more?

I just opened a PR that includes a specific version of @types/hoist-non-react-statics in the package.json. Hopefully that works? Certainly couldn't hurt.

@weswigham, do you mind reviewing and giving approval?

https://github.com/DefinitelyTyped/DefinitelyTyped/pull/33979

I don’t know if that is the correct fix. I added a direct dependency on hoist-non-react-statics@latest and it fixed all problems.

Ugh, @weswigham + @sandersn — I'm not sure what to do. The Travis build failed because I added a specific versionspec for @types/hoist-non-react-statics. See the error here.

It's true that my change to @types/react-redux _requires_ a minimum of 3.3.0 of @types/hoist-non-react-statics, so I feel like I should be able to express that constraint. Can you help me understand how to do that? (Should I do as the error message says and add it to dependenciesWhitelist.txt in types-publisher? That seems like too big a hammer.)

It's not too big a hammer - your issue is pretty much exactly what the log message describes (except we've also then once again swapped back to the underlying package not shipping types, quite the saga).

Cool, I have a PR ready to merge over on types-publisher: https://github.com/Microsoft/types-publisher/pull/595

@weswigham — can you land it?

It's published as of 3:06 PDT (40 minutes before this comment or so).

Okay folks, give @types/[email protected] a try and let me know if you're still broken.

Still the same problem with @types/[email protected]. The only fix that has worked for me is to manually require hoist-non-react-statics in my project

Seconded, still broken in @types/[email protected].

@jamesreggio @weswigham I'm not sure if you have seen the comments but pinging you so we're sure you have seen it

Yes, thanks, I had. I was teaching React this afternoon at Cisco when this bit the class. After a quick check and I found this thread I had them back down to 7.0.1 and it worked OK. But, I have some slight weirdness. If I add hoist-non-react-statics it works, as described above. If I uninstall hoist-non-react-statics it continues to work. So maybe there is a real dependency that gets picked up there, but sticks around even if you remove that package. If I clear out node_modules and package-lock.json and reinstall without hoist, it's broken again. I have to get out of here now, so I can't spend anymore time on it right now trying to dig deeper. Somebody else might find it faster anyways being more in tune with the package.

I’m going to dig into this again tomorrow, but honestly, I need some help
from an expert. The intricacies of the TS module system baffle me. I feel
like I’ve done everything correctly here...

Can those of you who are having the problem please paste a gist of your
package-lock.json or yarn.lock? I feel like this may be a problem related
to the unusual fact that hoist-non-react-statics included its own typings
for a short period in the past.

On Thu, Mar 21, 2019 at 20:03 Joel Mussman notifications@github.com wrote:

Yes, thanks, I had. I was teaching React this afternoon at Cisco when this
bit the class. After a quick check and I found this thread I had them back
down to 7.0.1 and it worked OK. But, I have some slight weirdness. If I add
hoist-non-react-statics it works, as described above. If I uninstall
hoist-non-react-statics it continues to work. So maybe there is a real
dependency that gets picked up there, but sticks around even if you remove
that package. If I clear out node_modules and package-lock.json and
reinstall without hoist, it's broken again. I have to get out of here now,
so I can't spend anymore time on it right now trying to dig deeper.
Somebody else might find it faster anyways being more in tune with the
package.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/DefinitelyTyped/DefinitelyTyped/issues/33690#issuecomment-475477877,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAyLva1P2ZGe86669tG7yu7fe1yMWWf-ks5vZEgHgaJpZM4bjI1Z
.

Hi James,

OK I understand what is wrong in my class project. I don't know how to fix it, yet. But, I'm going to put out what I know, and maybe somebody at Definitely Typed might be able to help you.

react-router is installed before react-redux by the previous lab. The current version of react-router (up until 4 days ago) was 4.3.1, and has a dependency on [email protected]. So, under the rules since nobody else had any dependency on hoist-non-react-statics the package was installed at the top level of node_modules. Now [email protected] is installed. It depends on [email protected]. But, since 2.2.5 is already at the top level, it puts 3.3.0 in the node_modules folder UNDER react-redux. So it appears that the dependency in @types/react-redux of @types/[email protected] doesn't find it because it's not at the top level. Those rules I haven't dug into yet, but someone else may be able to pin that down right away.

Other folks issues described earlier may be very similar to this scenario.

Related question: how are we supposed to know which version of @types/react-redux maps to which version of react-redux? Since the numbers don't line up, I'm lost there.

I've made a PR to fix this issue #34090

Shouldn't this issue be reopened as the underlying problem isn't fixed yet with version 7.0.5?
(without adding @types/hoist-non-react-statics + hoist-non-react-statics to the devDependencies)

100% agree this should not be closed, still broken unless you manually add to devDependancies

I have filed the proper fix that the people here have seemed to ignore since the beggining: #34406

So now that the PR is merged the react-redux types has to update the dependency on hoist-non-react-statics?

I think so. But i think you can get away with removing the dependency (uninstall it), and re-adding it


From: Maurice notifications@github.com
Sent: Thursday, April 4, 2019 3:53:32 PM
To: DefinitelyTyped/DefinitelyTyped
Cc: wolfy1339; Manual
Subject: Re: [DefinitelyTyped/DefinitelyTyped] [@types/react-redux] 'hoist-non-react-statics' has no exported member 'NonReactStatics' (#33690)

So now that the PR is merged the react-redux types has to update the dependency on hoist-non-react-statics?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHubhttps://github.com/DefinitelyTyped/DefinitelyTyped/issues/33690#issuecomment-480039685, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AEYfFbvvu7_1ZrU42jUUxkBX3uw7ucKDks5vdlg8gaJpZM4bjI1Z.

You mean the react-redux typings? I'll try that.

@wolfy1339 https://github.com/DefinitelyTyped/DefinitelyTyped/pull/34406 didn't seem to fix the issue for me. I think this is because hoist-non-react-statics will be installed inside of @types/hoist-non-react-statics (node_modules/@types/hoist-non-react-statics/node_modules/hoist-non-react-statics), so TS still uses the types from my root version (node_modules/hoist-non-react-statics).

At this point it was worth the try. Anyone else have an idea?

@weswigham Can you reopen this issue?

Had similar issue - using yarn instead of npm to install dependencies resolved my issue. Posting as a side note because maybe you guys can give it a try as a workaround.

@alan-mroczek We use yarn so no this doesn't help. There must be something else at play here. (lock file?)

I don't know if I understand the exact issue, but the solution that worked for me with yarn was to add a resolutions field to package.json.

"resolutions": {
  "hoist-non-react-statics": ">=3.3.0"
}

This problem is still active for "@types/react-redux": "7.0.8", and setting "resolutions" is not an universal solutions because "resolutions" don't work in monorepo (yarns workspaces)

And I don't expect it to be the solution anyway. In my opinion the @types package after it is installed should "just work"

Could the solution to this whole ordeal be to add it as a peer dependency? Sure it's not foolproof, but it's the only way to guarantee that typescript finds the required dependency

Get Outlook for Androidhttps://aka.ms/ghei36


From: Maurice notifications@github.com
Sent: Monday, April 29, 2019 12:30:06 PM
To: DefinitelyTyped/DefinitelyTyped
Cc: wolfy1339; Mention
Subject: Re: [DefinitelyTyped/DefinitelyTyped] [@types/react-redux] 'hoist-non-react-statics' has no exported member 'NonReactStatics' (#33690)

And I don't expect it to be the solution anyway. In my opinion the @typeshttps://github.com/types package after it is installed should "just work"


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/DefinitelyTyped/DefinitelyTyped/issues/33690#issuecomment-487649204, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABDB6FL2OUVTTX754VHATFLPS4PA5ANCNFSM4G4MRVMQ.

Tried many things, downgrading to @types/react-redux 7.0.1 is still the only fix that works at the moment.

The same for me ! But I hope a real fix will come one day (keeping this outdated dependency is odd !).

I think we need to do the same thing as #34406 in the react-redux typings, and just add a direct dependency on hoist-non-react-statics, as NPM & Yarn aren't necessarily going to put the "correct" version of hoist-non-react-statics in the directory above @types/react-redux (which will cause TS to grab v2.5's built-in index.d.ts if it's there)

This is a really gnarly solution (and could theoretically be mitigated if TypeScript would allow us to import @types/hoist-non-react-statics/index.d.ts directly, but I'm not seeing any reasonable alternatives (and basically anybody else who depends on @types/hoist-non-react-statics is going to need to do the same)

I think we need to do the same thing as #34406 in the react-redux typings, and just add a direct dependency on hoist-non-react-statics, as NPM & Yarn aren't necessarily going to put the "correct" version of hoist-non-react-statics in the directory above @types/react-redux (which will cause TS to grab v2.5's built-in index.d.ts if it's there)

This is a really gnarly solution (and could theoretically be mitigated if TypeScript would allow us to import @types/hoist-non-react-statics/index.d.ts directly, but I'm not seeing any reasonable alternatives (and basically anybody else who depends on @types/hoist-non-react-statics is going to need to do the same)

What about importing from '../hoist-non-react-statics'?
As far as I see the package '@types/hoist-non-react-statics' is automatically installed when '@types/react-redux' is installed, so there should be no risk of it missing.
I attached 2 files to show a solution that works for me.

hoist-non-react-statics_index.d.txt
react-redux_index.d.txt

Given the way that npm works, we can't guarantee that the hoist-non-react-statics typings will be in a sibling directory of react-redux. Depending on what other dependencies the user has installed, it it could be a grandparent, or it could be a child.

This is still broken for me. My export default connect()(MyComponent) is given an any type. Going back to 7.0.1 fixes this part... This appears to be a change in 7.0.2.

Still happens with 7.1.0 and downgrading to 7.0.1 isn't an option for us because we need TS 3.5.2 (with TS 3.4.5, 7.0.1 does work) and that throws the following error with 7.0.1:

node_modules/@types/react-redux/index.d.ts:109:84 - error TS2344: Type 'GetProps<C>' does not satisfy the constraint 'Shared<TInjectedProps, GetProps<C>>'.
  Type 'unknown' is not assignable to type 'Shared<TInjectedProps, GetProps<C>>'.

So, any.. workarounds? I am not an expert on the subject, so I can't understand what I need to do with this.

@tsakalidiskostas

Well, we decided that we will commit a modified version of the react-redux types to our repo. (After deciding against using patch-package. Which can be an alright temporary solution if you don't mind the necessary yarn workaround.)

Where we simply change the following line:

> = ComponentClass<JSX.LibraryManagedAttributes<C, P>> & hoistNonReactStatics.NonReactStatics<C> & {

to:

> = ComponentClass<JSX.LibraryManagedAttributes<C, P>> & {

Since we don't use statics, it doesn't hurt us but that may of course not be an acceptable solution for everyone.

Cool! I went with @alessioprestileo 's suggestion of changing

import hoistNonReactStatics = require('hoist-non-react-statics');

for

import { NonReactStatics } from '../hoist-non-react-statics';

and changing the call to

> = ComponentClass<JSX.LibraryManagedAttributes<C, P>> & NonReactStatics<C> & {

and it worked for me as well, was actually just heading to update when I saw your answer :D

So would you publish new version in npm with fixes?:)

Can we just get the maintainers of hoist-non-react-statics to check the typings back into their repo?

So.. is this happening or should I go forward with a fork change on that?

Hi there. We also updated to the latest 7.1.1 of @types/react-redux version with react-redux: 7.1.0 and we are seeing this error with npm. I'm confused since all tickets referring to this are closed.
A downgrade to 7.0.1 does fix this problem but causes a new problem if we use the latest Typescript Version 3.5.x:

/.../node_modules/@types/react-redux/index.d.ts(109,84): error TS2344: Type 'GetProps<C>' does not satisfy the constraint 'Shared<TInjectedProps, GetProps<C>>'.
  Type 'unknown' is not assignable to type 'Shared<TInjectedProps, GetProps<C>>'.
    Type 'Matching<TInjectedProps, GetProps<C>>' is not assignable to type 'Shared<TInjectedProps, GetProps<C>>'.
      Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : TInjectedProps[P] : GetProps<C>[P]' is not assignable to type 'TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never'.

making it a kinda sad workaround.

The a latest version (ie, 7.1.1) of @types/react-redux do not use Shared<TInjectedProps, GetProps<C>> as a constraint (precisely because of that fix in TS that pointed out that the constraint was incorrect) - you have another library which is forcing a nested include of an older version of the react-redux types, I think.

So, I have the workaround. It is called "patch package".

If you haven't used patch package before it is actually quite easy! You simply add it to your config, npm install it, then you just hit a patch package command on the changed module you have fixed and is working and voila. Now you have a few module that resides under patch package that has only the changed files of the module you was fixing, nothing too fancy or too big etc.. The error is fixed, the dependency is not lost, so when / if they fix it you can easily just delete one or two files and it is all fine

I can confirm that installing hoist-non-react-statics resolves this error for react-redux 7.1.0 and @types/react-redux 7.1.1 I'm using Typescript 3.4.3 as well.

I don't know why this issue is closed, however. Is there a more reasonable solution, without having to patch the package or override the module resolutions tree?

I'm having the same issue as @jalMogo

Still seeing this issue.

@jalMogo as far as I understand it, this is not an issue with redux, but with hoist-non-react-statics and that's why the issue is closed here. There are multiple workarounds in the thread, but better would be if someone skilled enough gave the hoist-people a fix.

I disagree that it is an issue with hoist-non-react-statics. It is an issue with the description of redux, in that it ends up looking at the older and wrong version of hoist-non-react-statics if it exists in the node_modules tree, which it does when some other stuff like the router is installed. The dependency needs to be described properly and the new version properly installed closer in the node_modules tree.

This is still an issue.

+1

I'm still getting this issue and the lint says there is an error in the code. Is anyone still working on this or is it considered closed? I have all the latest versions installed and still get:

Namespace '"/home/myhome/Projects/node_modules/hoist-non-react-statics/index"' has no exported member 'NonReactStatics'.ts(2694)

This is definitely an issue on their part. Workaround: @types/hoist-non-react-statics should be listed as a dependency in YOUR project for it to work

But i have that, and still get the issue:
"dependencies": {
...
"@types/hoist-non-react-statics": "^3.3.1",

is in my package.json

My bad. You need hoist-non-react-statics


From: Robert Rehammar notifications@github.com
Sent: Sunday, October 20, 2019 1:50:51 AM
To: DefinitelyTyped/DefinitelyTyped DefinitelyTyped@noreply.github.com
Cc: wolfy1339 wolfy1339@outlook.com; Mention mention@noreply.github.com
Subject: Re: [DefinitelyTyped/DefinitelyTyped] [@types/react-redux] 'hoist-non-react-statics' has no exported member 'NonReactStatics' (#33690)

But i have that, and still get the issue:
"dependencies": {
...
"@types/hoist-non-react-statics": "^3.3.1",

is in my package.json


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/DefinitelyTyped/DefinitelyTyped/issues/33690?email_source=notifications&email_token=ABDB6FORFBHI575QMINWIQ3QPPWTXA5CNFSM4G4MRVM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBYC7IY#issuecomment-544223139, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABDB6FLBLRAIO2PIIGMMJY3QPPWTXANCNFSM4G4MRVMQ.

I have "hoist-non-react-statics": "^3.3.0" in my dependencies and "@types/hoist-non-react-statics": "^3.3.1" in my devDependencies and I still have the problem myself as well. I have confirmed no other libraries are pulling in older versions of these either.

I also tried without explicitly installing "@types/hoist-non-react-statics" (because from what I understand, the main package should have typings included already), but with the same result.

Anyone facing this problem should provide a runnable reproduction, otherwise we can not offer any help.

I'm sorry, the project I'm experiencing this is not open-source and I do not have the time to create a separate project to showcase it. What I did notice however is the project had no issues until I enabled allowJs: true in the tsconfig.json. Without this setting, everything worked fine still. Hope it helps.

adding the 'hoist-non-react-statics' seems to have fixed it here.

repro is just installing @types/react-redux and then importing anything in react-redux in a tsx file.

One way to fix this issue is to add "skipLibCheck": true in tsconfig.json. It isn`t the best solution, but as a workaround, it may be used.

I think this happens because typescript resolves things in this order:

  1. package/package.json[types]
  2. @types/package
  3. package (everything except the types field)

Why it does that is a mystery to me, but its documented here: https://www.typescriptlang.org/docs/handbook/module-resolution.html#how-typescript-resolves-modules

So for example, if you have the following directory structure:

node_modules/
  @types/
    hoist-non-react-statics/ (3.3.0)
    react-redux/
      node_modules/
        hoist-non-react-statics/ (3.3.0)

  hoist-non-react-statics/
    package.json (2.0, which has a types field!!!)
    index.d.ts

Then typescript will do the following:

  1. fail to get types from node_modules/@types/react-redux/node_modules/hoist-non-react-statics because the current version does not include types
  2. succeed in finding types from node_modules/hoist-non-react-statics (the old version) because its package.json has a types field

hence as others have mentioned you can fix the problem by adding a dependency in your project on the latest hoist-non-react-statics, because that doesn't have a types field in package.json so it makes step 2 fail.

Ironically, you can also fix it by adding a dependency in your project on an older hoist-non-react-statics, e.g. 3.0.0. This works because it forces the correct version (3.3.0) to be installed in node_modules/@types/react-redux/node_modules/types/hoist-non-react-statics, where it is resolved earlier :confounded:

So I have two questions:

  1. Why does typescript treat the types field specially in this way, and it comes before or after @types packages depending on whether t the types field is used or not?
  2. If hoist-non-react-statics once had built in types, why did they get renegaded to here? This wouldn't be a problem if the types were built into package. I can't see how yarn/NPM can properly deal with separate packages for code and types seeing as they don't know how the two are connected.

This issue seems to have resurfaced with the latest package versions, ie:

[email protected]
@types/[email protected]

I was able to resolve this by manually including the following packages in my package.json:

[email protected]
@types/[email protected]

Because the hoist-non-react-statics packages after my initial npm install there were duplicates of these packages in my node_modules folder. Running npm dedupe cleared that up.

Hope that helps anyone else who comes along!

I had this issue as well - praise be to @DannyDelott 's solution!

I had this issue as well - praise be to @DannyDelott 's solution!

Quickest solution for now without polluting your package.json with dependencies you don't directly need is to remove @types/react-redux

npm remove @types/react-redux

Once we see that this issue have been resolved, then we can put it back

Issue is still happening and the only way to fix this is to add the mentioned dependencies to your project. This is not ideal, though, so hopefully we'll get a fix soon!

Still noticing this issue.

For anyone willing to keep developing while a stable fix will be live, you can use the typedef below:

// [your-src-folder]/types/hoist-non-react-statics.d.ts

declare module 'hoist-non-react-statics' {
  type NonReactStatics<T> = any;
  export { NonReactStatics }
}

This it's not the ideal solution, but at least is useful for avoiding build errors with TS

Was this page helpful?
0 / 5 - 0 ratings