use-http icon indicating copy to clipboard operation
use-http copied to clipboard

React 18 StrictMode

Open zvi1977 opened this issue 2 years ago • 22 comments

Hi, Are there plans to support React 18 ?

zvi1977 avatar May 22 '22 09:05 zvi1977

Seconding this, I'm getting unable to resolve dependency tree when trying to install on a new React project...

t3db0t avatar May 24 '22 14:05 t3db0t

It installs fine for me, try with --legacy-peer-deps flag.

wintercounter avatar May 28 '22 20:05 wintercounter

It installs fine for me, try with --legacy-peer-deps flag.

Thanks , indeed it installs with this flag , however, in runtime I realized that use-http doesn't work with React.StrictMode and React 18... found a related issue : https://github.com/ava/use-http/issues/368

zvi1977 avatar May 29 '22 12:05 zvi1977

Did any one found the root cause of what causing this ?

krishnasaga avatar Dec 03 '22 18:12 krishnasaga

zvi1977 I added my findings of root cause here https://github.com/ava/use-http/issues/368#issuecomment-1336209937.

https://github.com/ava/use-http/issues/368

krishnasaga avatar Dec 04 '22 13:12 krishnasaga

How is it even possible that this library is not supporting v18? :O

enriquemorenotent avatar Jan 20 '23 18:01 enriquemorenotent

@enriquemorenotent what do you men by not supporting ?

krishnasaga avatar Jan 23 '23 18:01 krishnasaga

@krishnasaga Have you tried doing npm i use-http on a React v18 app? It will give you an error.

You can "force it", of course. But it doesn't inspire a lot of confidence.

enriquemorenotent avatar Jan 23 '23 21:01 enriquemorenotent

@enriquemorenotent There reason you receive this error is because of this https://github.com/ava/use-http/blob/031b2ee8e00241fc8585dda7cf0c135eda5a181a/package.json#L17-L19 it is explicitly mentioned in pear dependencies as react 16 or react 17

By resolving this issue and successfully passing all the tests. use-http can start supporting react 18. then we can update the pear dependencies so you will not get that error when you install it.

krishnasaga avatar Jan 23 '23 23:01 krishnasaga

@krishnasaga I am not sure I understand what you are asking me...

enriquemorenotent avatar Jan 23 '23 23:01 enriquemorenotent

It will give you an error.

More a warning I would say, this library has not been certified compatible with React v18 yet. I have been using it with React v18 without too much problems other than this issue here with <StrictMode />

If you happen to know a way to make it fully compatible with React v18, feel free to contribute, this is Open Source ;)

flo-sch avatar Jan 24 '23 09:01 flo-sch

@flo-sch I would call it a warning, if it actually installed the package. But since it doesn't, I call it an error.

Sadly no, I have no idea how to make it work.

enriquemorenotent avatar Jan 24 '23 11:01 enriquemorenotent

Oh okay, I have not used npm in years now, did not know it would prevent to install it 🤷 yarn just warns about the version potentially not supported. the --force flag of npm should work until this issue is resolved

flo-sch avatar Jan 24 '23 12:01 flo-sch

@alex-cory there is a duplicate of this thread which I have mentioned. If it making sense to close one of those could you do it please ?

krishnasaga avatar Mar 13 '23 16:03 krishnasaga

If someone creates a PR for this I'll gladly accept it.

alex-cory avatar Mar 14 '23 13:03 alex-cory

@alex-cory Can I have your permission to copy the code of use-http to use directly in my project without importing, so I can have have that fix in my project without needing to depend on the release and also allows me to battle test it against multiple scenarios.

krishnasaga avatar Apr 09 '23 18:04 krishnasaga

@krishnasaga it's MIT licensed, you already have permission.

csvan avatar Apr 25 '23 10:04 csvan

Is there a timeline on react 18 support? our company pipeline doesnt allow force or using legacy deps when doing npm install

TannerS avatar Jun 29 '23 23:06 TannerS

Lol, that's something I never heard of. For me 9 out of 10 projects have to use --legacy-peer-deps. Just because a package hasn't been updated since the release of npm v7 it doesn't mean it's a security risk.

wintercounter avatar Jun 30 '23 05:06 wintercounter

I'm not saying your wrong, but I am gonna say we don't have much of a choice. It's a pipeline hundreds of services use and the commands don't include adding that flag, it only runs npm install and anything else errors out

Sent from my T-Mobile 5G Device Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Victor Vincent @.> Sent: Friday, June 30, 2023 12:57:39 AM To: ava/use-http @.> Cc: Tanner Summers @.>; Comment @.> Subject: Re: [ava/use-http] React 18 StrictMode (Issue #369)

Lol, that's something I never heard of. For me 9 out of 10 projects have to use --legacy-peer-deps. Just because a package hasn't been updated since the release of npm v7 it doesn't mean it's a security risk.

— Reply to this email directly, view it on GitHubhttps://github.com/ava/use-http/issues/369#issuecomment-1614166500, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACDUUD6O3QNK3564LKFGXX3XNZTFHANCNFSM5WTDVHPA. You are receiving this because you commented.Message ID: @.***>

TannerS avatar Jun 30 '23 12:06 TannerS

So is it a strict rule, or you just cannot modify the command the CI will run? Because in that case, you can just add in .npmrc until this gets resolved.

On Fri, Jun 30, 2023 at 2:36 PM Tanner Summers @.***> wrote:

I'm not saying your wrong, but I am gonna say we don't have much of a choice. It's a pipeline hundreds of services use and the commands don't include adding that flag, it only runs npm install and anything else errors out

Sent from my T-Mobile 5G Device Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Victor Vincent @.> Sent: Friday, June 30, 2023 12:57:39 AM To: ava/use-http @.> Cc: Tanner Summers @.>; Comment @.> Subject: Re: [ava/use-http] React 18 StrictMode (Issue #369)

Lol, that's something I never heard of. For me 9 out of 10 projects have to use --legacy-peer-deps. Just because a package hasn't been updated since the release of npm v7 it doesn't mean it's a security risk.

— Reply to this email directly, view it on GitHub< https://github.com/ava/use-http/issues/369#issuecomment-1614166500>, or unsubscribe< https://github.com/notifications/unsubscribe-auth/ACDUUD6O3QNK3564LKFGXX3XNZTFHANCNFSM5WTDVHPA>.

You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/ava/use-http/issues/369#issuecomment-1614590991, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHLJQGZ6CID6NESEGHY5LTXN3B3TANCNFSM5WTDVHPA . You are receiving this because you commented.Message ID: @.***>

wintercounter avatar Jun 30 '23 13:06 wintercounter

Far as I know the DevOps team controls the pipeline for hundreds of teams so we have no say in how it's ran, and we also don't control the npmrc file, locally yes but in the pipeline it's all DevOps configs.

I really love this lib and don't wanna abandon it but it's the only dep blocking multiple of our services from going to react 18.

That is why I was curious on if there is maybe an estimated time

Sent from my T-Mobile 5G Device Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Victor Vincent @.> Sent: Friday, June 30, 2023 8:06:37 AM To: ava/use-http @.> Cc: Tanner Summers @.>; Comment @.> Subject: Re: [ava/use-http] React 18 StrictMode (Issue #369)

So is it a strict rule, or you just cannot modify the command the CI will run? Because in that case, you can just add in .npmrc until this gets resolved.

On Fri, Jun 30, 2023 at 2:36 PM Tanner Summers @.***> wrote:

I'm not saying your wrong, but I am gonna say we don't have much of a choice. It's a pipeline hundreds of services use and the commands don't include adding that flag, it only runs npm install and anything else errors out

Sent from my T-Mobile 5G Device Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Victor Vincent @.> Sent: Friday, June 30, 2023 12:57:39 AM To: ava/use-http @.> Cc: Tanner Summers @.>; Comment @.> Subject: Re: [ava/use-http] React 18 StrictMode (Issue #369)

Lol, that's something I never heard of. For me 9 out of 10 projects have to use --legacy-peer-deps. Just because a package hasn't been updated since the release of npm v7 it doesn't mean it's a security risk.

— Reply to this email directly, view it on GitHub< https://github.com/ava/use-http/issues/369#issuecomment-1614166500>, or unsubscribe< https://github.com/notifications/unsubscribe-auth/ACDUUD6O3QNK3564LKFGXX3XNZTFHANCNFSM5WTDVHPA>.

You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/ava/use-http/issues/369#issuecomment-1614590991, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHLJQGZ6CID6NESEGHY5LTXN3B3TANCNFSM5WTDVHPA . You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHubhttps://github.com/ava/use-http/issues/369#issuecomment-1614625649, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACDUUDYNXIH7XYHUJ2QMYCLXN3FN3ANCNFSM5WTDVHPA. You are receiving this because you commented.Message ID: @.***>

TannerS avatar Jun 30 '23 13:06 TannerS