The following route works great and displays the AdministratePage component:
<Route path="/admin" component={AdministratePage} />
However this route:
<Route path="/admin/all" component={AdministratePage} />
...results in the following error:
http://localhost:8080/admin/bundle.js 404 (Not Found)
Where do I go wrong? Am I not allowed to use any path?
I'm using react-router-dom 4.1.2.
My webpack.config.js :
output: {
path: path.resolve('dist'),
filename: '/bundle.js'
},
My index.html:
<div id="app"></div>
Thank you.
Slash looks useless here
Also try to define publicPath
https://webpack.js.org/guides/public-path/
Another way of solving this problem is to add the following tag to your
index.html
page:React-router v4 now allows you to use regexes to match params
It uses path-to-regexp
path-to-regexp