As @ alexander-t mentioned:
path="/user/manage/:id/:type"
If you want to leave them optional:
path="/user/manage(/:id)(/:type)"
React Router v4
React Router v4 is different from v1-v3, and optional path parameters are not explicitly defined in the documentation .
Instead, you must specify a path parameter that path-to-regexp understands. This provides more flexibility in defining your paths, such as repeating patterns, wildcards, etc. Therefore, to define a parameter as optional, you add an end question mark (?).
So, to determine the optional parameters, you can do:
path="/user/manage/:pathParam1?/:pathParam2?"
those.
<Route path="/user/manage/:pathParam1?/:pathParam2?" component={MyPage} />
Whereas in V4 the required parameters are still the same:
path="/user/manage/:id/:type"
To access the PathParam value, you can do:
this.props.match.params.pathParam1
source share