I am trying to define a react route that can contain multiple different options.
I am trying to avoid defining a route for each, like below:
<Route path='/option1' component={Testing}/>
<Route path='/option2' component={Testing}/>
<Route path='/option3' component={Testing}/>
In Express, I am able to do this using app.get('/:name(option1|option2|option3)?', (req, res) => {}
and then access this data via req.params.name
Also, is there a way that i can pass the path parameter (i.e option1), into my component via props? How would i do this?