Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: react-router-dom-v5-compat not importing react-router-dom v5 in tests (DX) #8770

Open
Streeterxs opened this issue Apr 6, 2022 · 2 comments
Labels

Comments

@Streeterxs
Copy link

What version of React Router are you using?

v5-compat

Steps to Reproduce

Import a Switch from "react-router-dom":

import { Switch } from "react-router-dom";

...
    console.log({Switch});
    act(() => {
      ReactDOM.render(
        <MemoryRouter initialEntries={["/home"]}>
          <CompatRouter>
            <Switch>
              <CompatRoute path="home" element={<Home />} />
              <CompatRoute path="/details" element={<Details />} />
            </Switch>
          </CompatRouter>
        </MemoryRouter>,
        node
      );

image

Expected Behavior

After yarn install and yarn build (as CONTRIBUTING.md says) should install react-router-dom from packages/react-router-dom-v5-compat/package.json peerDependencies to permit usage and testability of CompatRoute and CompatRouter

Actual Behavior

Breaking my CompatRoute fail test on Switch usage (and CompatRouter useHistory() as well).

@Streeterxs Streeterxs added the bug label Apr 6, 2022
@rtlong
Copy link

rtlong commented Aug 16, 2022

@Streeterxs Did you find a workaround for this?

@github-actions
Copy link
Contributor

This issue has been automatically marked stale because we haven't received a response from the original author in a while 🙈. This automation helps keep the issue tracker clean from issues that are not actionable. Please reach out if you have more information for us or you think this issue shouldn't be closed! 🙂 If you don't do so within 7 days, this issue will be automatically closed.

brophdawg11 pushed a commit that referenced this issue Mar 27, 2024
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants