reactjsreact-routerreact-routing

React router. Cannot GET when refreshing a page or write url manually


I am trying to build a SPA with react router. When I am navigating with link it works perfect, but with refreshing or writting url it gives me cannot GET /(any route except main). I was trying to add historyApiFallback : true option to my webpack dev server configs but it didnt solved it.

I will appreciate any help.


Solution

  • This is documented (and now I have written 30 characters): https://github.com/reactjs/react-router/blob/v2.3.0/docs/guides/Histories.md#browserhistory