I am currently trying to match the following URL
https://www.example.com/discover/exampleuser/review
there are other urls that i am matching with regex as well
https://www.example.com/discover/community
https://www.example.com/discover/reviews
https://www.example.com/discover/activity
I have the following code that will match the last three urls fine
<Route path={`${url}/(community|reviews|activity)`} render={prop => (
<div className='mb-4'>
<CollectionWidget { ...prop } />
</div>
)} />
Whenever I use the following path it works
{`${url}/:username`}
however when i try to match all of the urls like so it does not
{`${url}/(community|reviews|activity|:username)`}
How do i match regex with a ambiguous id
{${url}/(community|reviews|activity|${:username})}Does that help?match.params.userjust silently ignored in target component? if there areif ... else ...inside the component it'd be better to refactor all that into 2 separate components bound to different(parametrized and without parameters) routes.