following this tutorial Add routing to a custom UI full page app , when I use useLocation to get the state, the state is always null:
function Link({ to, children }) {
const navigate = useNavigate();
return (
<a
href={to}
onClick={(event) => {
event.preventDefault();
navigate(to,{state:{id:1, name:"test"}});
}}
>
{children}
</a>
);
}
function PageWithPath() {
const location = useLocation();
console.log(location.state)
return <h2>Page with path</h2>;
}
is @forge/bridge(v2.1.3) compatible with react-router-dom(v6)? I noted that the version of history library api are different. can anyone please help me with this? Thank you