I use react with following dependencies with the specified versions
{
"react-router-dom": "^5.2.0",
"react-dom": "^16.14.0",
}
and I want to have a route like this
- Home
- About
- Home/Test
- Home/Test/New <== this is my problem
I have
<BrowserRouter>
<Switch>
<PublicRoute component={Login} path="/" exact />
<PublicRoute component={Login} path="/login" exact />
<PrivateRoute component={Dashboard} path="/dashboard"/>
<Route to="/404" component={NotFound} />
</Switch>
</BrowserRouter>
On the dashboard I have this
<Router>
<Navbar />
<Switch>
<Route path={`/dashboard/buyList`} component={BuyList} />
<Route exact path='/dashboard/buyList/new' component={NewBuy} />
<Route path={`/dashboard/buyList${ids.id}`} component={BuyInfo}/>
<Route path='/dashboard/showAddress' component={ShowAddress} exact/>
<Route path='/dashboard/qrScanner' component={QrScanner} exact/>
<Route path='/dashboard/productList' component={ProductList} exact/>
<Route path='/dashboard/productListCode' component={ProductListCode} exact/>
<Route path='/dashboard/deliveryScanner' component={DeliveryScanner} exact/>
<Route path='/dashboard' component={DashboardDetail} exact/>
<Route path="/404" component={NotFound} />
</Switch>
</Router>
but in "/dashboard/buyList/new"
is loading the component of "/dashboard/buyList"