Obtener parámetros en React Router DOM V6
import { useParams } from "react-router";
///
let {slug}=useParams()
Zany Zebra
import { useParams } from "react-router";
///
let {slug}=useParams()
const pathArray = window.location.pathname.split('/');
const id = pathArray[2];
const Child = ({ match }) => (
<div>
<h3>ID: {match.params.id}</h3>
</div>
)