Skip to content

react-router-dom -> react-router/dom #6755

Closed
@timdorr

Description

@timdorr

I'm seeing a lot of issues come up relating to mismatched versions/instances of the Context pair. This is made more likely because we have two packages (react-router and react-router-dom), one of which is an implicit dependency (i.e., you should be installing only react-router-dom and react-router comes along for the ride).

The most common issue seems to be when someone is using both react-router-dom and a library that depends on just react-router. A version mismatch is handled by npm by giving each package their own copy of react-router, which will result in two Context instances. Right now we only have one version with the new Context API, but expect this to flare up more and more with new versions, especially if we bump the minor or major.

I would like to see about including the react-router-dom contents within the react-router package as a separate importable module. To ease the transition, I would suggest making it available at react-router/dom, so that the change is only one character and can be easily find-and-replace'ed.

This is just a preliminary thought, so I haven't figured out all the edge cases yet. But I wanted to discuss it further before proceeding to write any code. So, is it a great idea or the greatest idea?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions