Answer the question
In order to leave comments, you need to log in
What is the problem when using BrowserRouter and getting 404 error?
Hello! Point me to the right path, I beg you.
There is a project .
Used HashRouter to route my application. Everything would be fine, but the lattice in the url began to strain. I changed it to BrowserRouter, besides, the specifics of the application are similar to the situation when, judging by the titorial , it is necessary to use the BrowserRouter (a dynamic application with asynchronous requests to a third-party API).
The root element looks like this:
<Provider store={store}>
<BrowserRouter basename={"/"}>
<App />
</BrowserRouter>
</Provider>
<Switch>
<Route exact path="/" component={Menu}/>
<Route path="/delivery" component={Delivery} />
<Route path="/pay" component={Pay} />
<Route path="/about" component={About} />
<Route path="/manager" component={Manager} />
<Route path="/personal" component={Personal} />
<Route component={NotFound} />
</Switch>
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