Coder Social home page Coder Social logo

Comments (3)

TkDodo avatar TkDodo commented on May 19, 2024

I can see two versions of react-query in your lock file, which is the reason. Each version has its own context, and the contexts aren't visible between versions:

https://github.com/PetrovaDaria/rq-monorepo-demo/blob/4cd3a7329252fa90d94fc08766f8106583bdbf3d/yarn.lock#L585-L599

from react-query.

PetrovaDaria avatar PetrovaDaria commented on May 19, 2024

Yes, but it is monorepo, it always has only one yarn.lock. Each app can have its own dependencies with different version number. If I don't specify common dependency in root package.json I am able to define different versions to each app what I did in this example.

from react-query.

TkDodo avatar TkDodo commented on May 19, 2024

in a monorepo, its advised to use the same version of dependencies across packages. We use a tool to enforce this: https://github.com/Thinkmill/manypkg

but of course, each app could have their own dependencies. I'm not sure how this works with peerDependencies, or how yarn does that resolving, or how suspensive-react-query comes into play.

you also have different versions of the devtools, and you're missing a fix we made with peerDependencies:

v4.29.0 depends on "@tanstack/react-query": "4.28.0"

v4.25.7 depends on "@tanstack/react-query": "^4.35.7".

the ^ makes all the difference, so please upgrade to at least latest v4 everywhere.

from react-query.

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.