Skip to content

Update to work with react-router v7 #326

Open

Description

@mikeycoxon

It a simple matter to make a version of this library with react router v7.

basically, its change the peer dependency from react-router-dom to react-router

and import that at the top of LinkContainer.js, as in:

import { useHref, useLocation, useMatch, useNavigate } from 'react-router';

everything else seems to work just fine. Two reasons why I didn't submit this as a PR were:

  1. didn't know if I had the privileges
  2. this would be a breaking change for anyone still reliant on react-routeer v6 (and therefore react-router-dom)

maybe publish a variant?

Activity

  1. segagnon-bell commented on Apr 9, 2025

    @segagnon-bell

    Hi,

    I am facing the same problem today. I find multiple threads about it in the issues here, but no one seems to be actioning them.

    Who is the maintainer on this package ? Who can we contact to get the ball rolling ?

  2. bkt0031 commented on May 2, 2025

    @bkt0031

    Same issue here as well. I'm experiencing the same error as #322 where I validated in my code that LinkContainer was indeed within the component. I tried to use a fork of this repository where the above fix was applied, but with react-router v7.5.x it still failed with the same response. My fix was to downgrade react-router-dom to v6.16.0 which is what I was using in my old code branch before I embarked on this whole Node.JS module refresh effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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