I am fairly new with react and routing, I was trying to migrate our routing from V5 to v6, and my router code was something like this:
<Router history={history} key={Math.random()}>
But after upgrading to router v6
, it gives me an error in the history props:
(property) history: BrowserHistory Type '{ children: Element; history: BrowserHistory; key: number; }' is not assignable to type 'IntrinsicAttributes & RouterProps'. Property 'history' does not exist on type 'IntrinsicAttributes & RouterProps'.
If history can not pass as a prop in Router, how should I handle this?