I have a URL like this :
"http:something/forget/reset?type=text&c=$something&cc=$something"
I want to get the parameters form this path and I used:
const params = useParams()
but it returns an empty object {}
my current route is like below:
<Route
path="forget/reset"
element={<ComponentA/>}
/>
so should I define a route with parameters like below or is there a way to get multiple parameters form a url
<Route path="forget" element={<ComponentA/>}>
<Route
path="forget/reset/:user/:c/:cc"
element={<ComponentA/>}
/>
</Route>
the above code also does not work.
<Route path="/forget/reset" element={<ComponentA />} />
. The queryString params would be accessed in the component for that route,ComponentA
. Are you saying you want/need additional/optional path parameters beyond"/forget/reset"
? What paths do you actually need to match? – Nuris