Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to use url parameters in react

//in route
<Route path="child/:id" children={<Child />} />
  
// in component
import { useParams } from "react-router-dom";

let { id } = useParams();
Source by v5.reactrouter.com #
 
PREVIOUS NEXT
Tagged: #url #parameters #react
ADD COMMENT
Topic
Name
6+3 =