Answer the question
In order to leave comments, you need to log in
How to correctly decompose routes in a project?
there is a main page, and there is a router like
<Router history={createBrowserHistory()} >
<ScrollToTop>
<Suspense fallback={<LoadingComponent />}>
<Switch>
<Route path="/" component={Wrapper} />
<Route exact path="/services" component={Services} />
<Route exact path="/login" component={Login} />
<Route component={NotFound} />
</Switch>
</Suspense>
</ScrollToTop>
</Router>
<Switch>
<Route exact path="/" component={Component1} />
<Route exact path="/" component={Component2} />
<Route exact path="/" component={Component3} />
</Switch>
Answer the question
In order to leave comments, you need to log in
<Switch>
<Route exact path="/services" component={Services} />
<Route exact path="/login" component={Login} />
<Route path="/" component={Wrapper} />
</Switch>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question