-1

I have upgraded react-router-dom to v6 from v5. Previously(v5) it used to work well. Here is the code.

<HashRouter>
    <Provider appStore={appStore}>
        <MemoryRouter>
            <Routes>
                <Route/>
            </Routes>
        </MemoryRouter>
    </Provider>
</HashRouter>
user3900196
  • 457
  • 2
  • 6
  • 18
  • The link you shared is not 'answered'. Not sure which is the right solution. – user3900196 Feb 07 '22 at 07:44
  • Is the error message not clear? You are rendering a router within another router. There only needs to be one single router to provide a routing context for the entire app. Remove one or the other of the `HashRouter` or `MemoryRouter`. – Drew Reese Feb 07 '22 at 16:42

1 Answers1

1

you actually do have a Router inside a Router remove either the memory router or hash Router and it should work fine

<Provider appStore={appStore}>
    <MemoryRouter>
        <Routes>
            <Route/>
        </Routes>
    </MemoryRouter>
</Provider>

it should work like this or remove memory router if you want I searched online and got same answers Hope i was able to help

Ahmed Ali
  • 257
  • 1
  • 7
  • 1
    Thank you. I guess i should have been more clear. In my case this part is coming from a different package. Not sure what other options i have. – user3900196 Feb 07 '22 at 11:23