With react-router
I can use the Link
element to create links which are natively handled by react router.
I see internally it calls t
Try hookrouter instead, "the modern alternative to react-router"
https://www.npmjs.com/package/hookrouter
import { useRoutes, usePath, A} from "hookrouter";
to answer OP question about linking through select box you can do it:
navigate('/about');
*** UPDATED ANSWER ***
I think hook-router was a good starter kit and helped me learn about routing but have since updated to react-router for it's history and query parameter handling.
import { useLocation, useHistory } from 'react-router-dom';
const Component = (props) => {
const history = useHistory();
// Programmatically navigate
history.push(newUrlString);
}
You push where you want to navigate into the location.history.