0

I have nested routes like this

 <Route path='/' component={App}>
   <IndexRedirect to='/in' />
   <Route path='in' component={Authentication(MainPage)} routes>
   <Route path='welcome' component={Welcome}/>
  </Route>
 <Route path='*' component={NotFound}/>
</Route>

Most of my routes look like this:

mysite.com/in/welcome

I'm not sure what React Router 4 is asking for. Do I need to define all of my "child routes" inside my MainPage component?

Christopher Mellor
  • 339
  • 1
  • 4
  • 18
  • mmm are you missing routes in your codeblock? `mysite.com/in/whatever` doesn't have a corresponding route in your example – azium Oct 21 '18 at 22:19
  • Sorry, I wasn't being literal to my code. I updated it to say `/welcome` to be more precise – Christopher Mellor Oct 21 '18 at 23:49
  • react router 4 is much simpler concept... wherever a Route component is placed is where the component content will render.. so only put child routes inside MainPage if you want to render them inside of MainPages render – azium Oct 22 '18 at 03:40

0 Answers0