0

For micro frontend routing purposes, I need to use custom history with

const history = createMemoryHistory()

In react-router v5 I was able to pass history directly to like below and it worked

<Router history={history}>

However, react-router v6 requires a navigator and location. I think passing history to the navigator makes sense but not sure how to pass location dynamically to make <Router> works

<Router navigator={history} location={???}>

I tried {location=history.location} but it stays at the same route.

Can someone help?

Thanks!!!

sean0923
  • 73
  • 5

0 Answers0