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

React 18 StrictMode #369

Open
zvi1977 opened this issue May 22, 2022 · 22 comments
Open

React 18 StrictMode #369

zvi1977 opened this issue May 22, 2022 · 22 comments

Comments

@zvi1977
Copy link

zvi1977 commented May 22, 2022

Hi,
Are there plans to support React 18 ?

@t3db0t
Copy link

t3db0t commented May 24, 2022

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

@wintercounter
Copy link

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

@zvi1977
Copy link
Author

zvi1977 commented May 29, 2022

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 :
#368

@zvi1977 zvi1977 changed the title React 18 React 18 StrictMode May 29, 2022
@krishnasaga
Copy link
Contributor

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

@krishnasaga
Copy link
Contributor

krishnasaga commented Dec 4, 2022

zvi1977 I added my findings of root cause here #368 (comment).

#368

@enriquemorenotent
Copy link

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

@krishnasaga
Copy link
Contributor

@enriquemorenotent what do you men by not supporting ?

@enriquemorenotent
Copy link

@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.

@krishnasaga
Copy link
Contributor

@enriquemorenotent There reason you receive this error is because of this

use-http/package.json

Lines 17 to 19 in 031b2ee

"peerDependencies": {
"react": "^16.13.1 || ^17.0.0",
"react-dom": "^16.13.1 || ^17.0.0"
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.

@enriquemorenotent
Copy link

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

@flo-sch
Copy link

flo-sch commented Jan 24, 2023

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 ;)

@enriquemorenotent
Copy link

@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.

@flo-sch
Copy link

flo-sch commented Jan 24, 2023

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

@krishnasaga
Copy link
Contributor

@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 ?

@alex-cory
Copy link
Collaborator

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

@krishnasaga
Copy link
Contributor

krishnasaga commented Apr 9, 2023

@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.

@csvan
Copy link

csvan commented Apr 25, 2023

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

@TannerS
Copy link

TannerS commented Jun 29, 2023

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

@wintercounter
Copy link

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.

@TannerS
Copy link

TannerS commented Jun 30, 2023 via email

@wintercounter
Copy link

wintercounter commented Jun 30, 2023 via email

@TannerS
Copy link

TannerS commented Jun 30, 2023 via email

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

No branches or pull requests

9 participants