Q:

How to make the path a variable in react-router?

Like I have   /a/Star/video
I want to make the video a variable, star is already a param. How to do it? I need to know is, When video is provided, I need to render one component and when it is not provided, I want to render another component?

A:

You can use nested routes and an <IndexRoute> to handle this:
<Route path='/a/:param1' component={Root}>
  <IndexRoute component={OnlyParam1} />
  <Route path='video' component={WithVideo} />
</Route>

