use-http
use-http copied to clipboard
React 18 StrictMode
Hi, Are there plans to support React 18 ?
Seconding this, I'm getting unable to resolve dependency tree
when trying to install on a new React project...
It installs fine for me, try with --legacy-peer-deps
flag.
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
Did any one found the root cause of what causing this ?
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
How is it even possible that this library is not supporting v18? :O
@enriquemorenotent what do you men by not supporting ?
@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 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 I am not sure I understand what you are asking me...
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 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.
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
@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 ?
If someone creates a PR for this I'll gladly accept it.
@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 it's MIT licensed, you already have permission.
Is there a timeline on react 18 support? our company pipeline doesnt allow force or using legacy deps when doing npm install
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.
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: @.***>
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: @.***>
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: @.***>