React-router-dom v4 nested routes not working

Posted by Jennifer | Updated on

React-router-dom v4 nested routes not working

This is one way of doing what you described (note there are other ways of handling layouts directly in your React Components). In order to keep the example simple, the other components (, etc.) are created as purely functional components with no properties or state but it would be trivial to put each one in its own file as a proper React component. The example below is complete and will run.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers