Below is the example of using React hook and the react-router-dom
package.
import { useParams } from "react-router-dom";
//hook example
const Example = () => {
const params = useParams(); //retreive params you need
console.log(params)
return (
<div>
//...other code
</div>
);
}
export default App;
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…