I created an app using create-react-app and I have nested routes in my App.js. The Public component displays but nothing else does , such as /login or /home.
I added the /login just to test out a simple page, because Dash Layout is also nesting other elements but it does not render. I don’t think it is a css issue because when I inspect the page there is nothing inside the [[enter image description here](https://i.sstatic.net/itfVQp7j.png)](https://i.sstatic.net/2HNl7OM6.png)
2
Answers
The problem was I was missing the astrisk after the '/' in the path in the index.js file:
</React.StrictMode>
You should structure your code in a different way.
In index.js:
You really don’t need to use two different
Routes
component (you are creating aRoutes
component with theApp
inside and then theApp
component has aRoutes
component too).