2

I have two routes like below

            <Route path='/dashboard/home' exact component={Charts} />
            <Route path='/dashboard/map-view' component={Mapview} />

If user is navigating to just '/dashboard' also I need to show '/dashboard/home' route. Whenever I click home also I need to show same. How can I make it

raj m
  • 1,863
  • 6
  • 21
  • 37
  • Possible duplicate of [How to set the DefaultRoute to another Route in React Router](https://stackoverflow.com/questions/29552601/how-to-set-the-defaultroute-to-another-route-in-react-router) – gazdagergo Aug 21 '18 at 07:39

1 Answers1

4

You can use Redirect:

<Redirect from='/dashboard' to='/dashboard/home'/>
Bhojendra Rauniyar
  • 83,432
  • 35
  • 168
  • 231