After upgrading to react router v6.7.0, I'm facing this issue. I'm passing the state in navigate but in the target page i get the state object first time, on rerenders state is null.
And navigate(-1) also not taking to previous page, remaining on same page.
navigate('traget url', {state:"mystatevalue" });
In the target page reading the state using uselocation.
const location= useLocation(); console.log(location.state);
//First time I get mystatevalue // 2nd and 3rd render null
const location= useLocation(); console.log(location.state);
//First time I get mystatevalue // 2nd and 3rd render null.