I want to achieve this(V3)
<Router> <Route path="/" component={App}/> <Route path="*" component={Whoops404}/> </Router> with V4 of react-router using react-router-dom but i'm unable to do that, when i try this
<BrowserRouter> <div> <Route path="/" component={App}/> <Route path="*" component={Whoops404}/> </div> </BrowserRouter> it renders all the routes in the block instead. am i doing wrong?
****EDIT****
Thank you guys.I have wrapped the routes with a Switch component,and its working fine but when i navigate to localhost:3000/jjj or other routes aside the http://localhost:3000/ the component App still displays.