1import { Route, useParams } from "react-router-dom";
2
3// Route with URL param of id
4<Route path="/:id" children={<Child />} />
5
6// We can use the `useParams` hook here to access
7// the dynamic pieces of the URL.
8let { id } = useParams();
1const Child = ({ match }) => (
2 <div>
3 <h3>ID: {match.params.id}</h3>
4 </div>
5)
1<Link to={{
2 pathname: '/tylermcginnis',
3 state: {
4 fromNotifications: true
5 }
6}}>Tyler McGinnis</Link>