Please am finding it difficult to create a route in react router
I want to create a route like this <Route path="/:storeId" component={StorePage} />
But I also have a route like this /stores
Any time I go to the /:storeId page it loads the /users page
Am just confuse
Here is the code
<Switch>
<ScrollToTop>
<MainLayout>
<Route exact path="/">
<Home />
</Route>
<Route exact path="/stores">
<Stores />
</Route>
<Route exact path="/:storeId">
<StorePage />
</Route>
</MainLayout>
</ScrollToTop>
</Switch>
Any help please.
<Switch> <ScrollToTop> <MainLayout> <Route exact path="/"> <Home /> </Route> <Route exact path="/stores"> <Stores /> </Route> <Route exact path="/:storeId"> <StorePage /> </Route> </MainLayout> </ScrollToTop> </Switch>Please I intentionally don't want<Route path="/stores/:storeId" />/usercase now. Maybe have a read of reactrouter.com/web/api/Switch and see if that helps. Specifically about the order of things