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]: No longer allowed to nest MemoryRouter inside Router #9109

Closed
dw-bayer opened this issue Jul 29, 2022 · 2 comments
Closed

[Bug]: No longer allowed to nest MemoryRouter inside Router #9109

dw-bayer opened this issue Jul 29, 2022 · 2 comments
Labels

Comments

@dw-bayer
Copy link

dw-bayer commented Jul 29, 2022

What version of React Router are you using?

6

Steps to Reproduce

<Router>
    // all sorts of normal app stuff
    // ...
    // ... deep in a nested component
    <Popup>
        <MemoryRouter initialEntries={[match.url]}>
            <ComponentWithRoutesThatIsAlsoUsedWithNormalRouer />
        </MemoryRouter>
    </Popup>
</Router>

Expected Behavior

We needed a way to take a component that exists in our normal routes with history.back() and redirects and gingerly place it into a dialog popup WITHOUT having any of the routing paths show up in the browsers url and without our in-app back buttons sending the user away from the dialog and still getting to navigate deeper into the component. Wrapping the MemoryRouter around the component nested inside the main Router worked without a hitch. Gave us a little Router sandbox.

Actual Behavior

Now, in v6, we're barred from doing that. :(
Can this be a warning instead of an error?
Is there something else we could/should be doing?

@timdorr
Copy link
Member

timdorr commented Jul 31, 2022

#7375 (comment)

@timdorr timdorr closed this as completed Jul 31, 2022
@dw-bayer
Copy link
Author

dw-bayer commented Aug 1, 2022

ope. sorry. terrible browsing skills.

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

2 participants