<Route path="/etc/:id/">
<Component />
</Route>
I notice, if :id
is not provided, then it wouldn't match.
How do I change it so that :id
is optional?
<Route path="/etc/:id/">
<Component />
</Route>
I notice, if :id
is not provided, then it wouldn't match.
How do I change it so that :id
is optional?
You should add a question mark at the end of the param to make it optional
<Route path="/etc/:id?">
<Component />
</Route>