Answer the question
In order to leave comments, you need to log in
How to solve react-router page reload problem?
The links are successfully followed, but it's worth reloading the page or going directly to the link, as it comes 404
I use react-router-dom
And on the server I address it this way:
app.js
Import api from './api.js'
app.use(webpackDevMiddleware(compiler,{
stats:{
historyApiFallback: true,
colors:true
}
}));
app.use(webpackHotMiddleware(compiler));
app.use('/',api);
app.use('/*', express.static(__dirname+ '/'));
const server = app.listen(8080,()=>{
console.log(`server up ${config.serverPort}`)
})
Answer the question
In order to leave comments, you need to log in
I think that the problem is in
what form do you have addresses in the browser, through /#/ or just / ?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question