React Router browserHistory not working as expected

前端 未结 4 702
无人共我
无人共我 2020-12-15 09:04

As a User i want to access content via going direkt on an deep url

Situation

On the Main Page i have a link to \"about\" page. clicking on the the Content ch

4条回答
  •  伪装坚强ぢ
    2020-12-15 09:30

    I had same problem. So as above @taion's answer told that we need to configure express server to make hot reloading with URLs in routes.

    But if you don't want to put express server additionally just to make hot reloading work, use this to run your project.

    webpack-dev-server -d --history-api-fallback --hot --inline --progress --colors
    

    Earlier, I was using just this which needs express server to be configured

    webpack-dev-server --hot --inline
    

    NOTE: But I still think, you need to configure for nginx when you'll deploy. The above commands I told are just for development purposes. So don't forget to look at this as @taion told.

提交回复
热议问题