Giter VIP home page Giter VIP logo

Comments (3)

Ashoat avatar Ashoat commented on May 22, 2024

@react-navigation/core is listed as a peer dependency because we import some utilities from there, but don't want to lock onto a specific version of react-navigation, and instead want to defer version selection to the user.

We could specify react-navigation as the peer dependency instead, which is what I tried in 4.0.0. Everything exported by @react-navigation/core is also exported by react-navigation. However, this breaks web support, which doesn't actually use the react-navigation package at all.

Using react-navigation directly would have a couple small benefits. One is that it would reduce the amount of peer dependency complaints yarn/npm make. They don't like that the version specification of @react-navigation/core is nested within another dependency (react-navigation) in your package.json, and as such don't consider it to technically be a "peer" dependency. But these errors can be safely ignored. The other benefit is that if you're using Flow, you end up having to install libdefs for both react-navigation as well as @react-navigation/core under the current setup. If we just used react-navigation, the user would only need one libdef.

These small benefits are outweighed by the cost of breaking web support, which is why we're keeping @react-navigation/core as the peer dependency.

from redux-helpers.

Ashoat avatar Ashoat commented on May 22, 2024

To your questions:

I am confused if I should add @react-navigation/core package to my project

If you're not importing anything directly from it, you don't need to bother. It is in your project by virtue of being a dependency of react-navigation. You will get yarn/npm errors about the peer dependency for the reasons mentioned above, but you can safely ignore them.

is it just for typings?

The typing for the mainline React Navigation packages (react-navigation, @react-navigation/core, etc.) are maintained via flow-typed. This project is the only one in the React Navigation org that hosts Flow types in-package.

from redux-helpers.

CptFabulouso avatar CptFabulouso commented on May 22, 2024

Nicely written, thanks a lot

from redux-helpers.

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.