Giter Club home page Giter Club logo

Comments (22)

t3db0t avatar t3db0t commented on June 2, 2024 2

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

from use-http.

flo-sch avatar flo-sch commented on June 2, 2024 1

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

from use-http.

flo-sch avatar flo-sch commented on June 2, 2024 1

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

from use-http.

alex-cory avatar alex-cory commented on June 2, 2024 1

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

from use-http.

csvan avatar csvan commented on June 2, 2024 1

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

from use-http.

wintercounter avatar wintercounter commented on June 2, 2024

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

from use-http.

zvi1977 avatar zvi1977 commented on June 2, 2024

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

from use-http.

krishnasaga avatar krishnasaga commented on June 2, 2024

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

from use-http.

krishnasaga avatar krishnasaga commented on June 2, 2024

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

#368

from use-http.

enriquemorenotent avatar enriquemorenotent commented on June 2, 2024

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

from use-http.

krishnasaga avatar krishnasaga commented on June 2, 2024

@enriquemorenotent what do you men by not supporting ?

from use-http.

enriquemorenotent avatar enriquemorenotent commented on June 2, 2024

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

from use-http.

krishnasaga avatar krishnasaga commented on June 2, 2024

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

from use-http.

enriquemorenotent avatar enriquemorenotent commented on June 2, 2024

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

from use-http.

enriquemorenotent avatar enriquemorenotent commented on June 2, 2024

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

from use-http.

krishnasaga avatar krishnasaga commented on June 2, 2024

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

from use-http.

krishnasaga avatar krishnasaga commented on June 2, 2024

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

from use-http.

TannerS avatar TannerS commented on June 2, 2024

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

from use-http.

wintercounter avatar wintercounter commented on June 2, 2024

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.

from use-http.

TannerS avatar TannerS commented on June 2, 2024

from use-http.

wintercounter avatar wintercounter commented on June 2, 2024

from use-http.

TannerS avatar TannerS commented on June 2, 2024

from use-http.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.