This error will appear in the following cases
The first
<Switch> <Route exact path="/home/index" component={HomeIndex} /> <Route path="/home/order" component={HomeOrder}> <Route path="/home/order2" component={HomeOrder2}></Route> </Route> <Route path="/home/assets" component={Assets} /> </Switch>
The following components can not be nested Route Route components , react-router4 version of the above would not allow such a write
The second (Super Pit !!!)
<Switch> <Route exact path="/home/index" component={HomeIndex} /> <Route path="/home/order" component={HomeOrder}> </Route> <Route path="/home/assets" component={Assets} /> </Switch>
You can not have a space between Route components wrap ! Therefore, either <Route> </ Route> or written in such a way and a self-closing tags <Route /> !!!