Define route
1 | <Route path="/editschedule/:id"> |
Create type
1 | export interface IParameters { |
Access route in browser
http://localhost:3000/editschedule/cd7df19f-f594-454f-a242-4ce5b28df6b0
Use hook useParams
1 | let params = useParams<IParameters>(); |
Access values
1 | {params.id} |
Expect to see cd7df19f-f594-454f-a242-4ce5b28df6b0