Answer the question
In order to leave comments, you need to log in
Route doesn't work on reload, is it my crooked hands or a React feature?
Good afternoon, the project itself is on React, it is going through Webpack
Let's say I go to localhost, then I poke on the Navbar on the right and go to this page, everything is as intended
But after I want to reload this page with the given route localhost/roulette , he can't load it
. Here's how I write all the routes:
// App
<BrowserRouter>
<AppRouter/>
</BrowserRouter>
// App Router
<Switch>
{publicRoutes.map(({path, Component, exact}) =>
<Route key={path} path={path} component={Component} exact={exact}/>
)}
<Route component={Page404}/>
</Switch>
// Public Routes
export const publicRoutes = [
{
path: CASE_ROUTE,
Component: Case,
exact: true
}
]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question