Thanks for your analysis, it helped me to realize it wasn’t an issue with React Router but my own paths.
I added <base href="https://stackoverflow.com/" /> into the <head> of my index.html and it worked (:
Edit for React Router 3:
Since early 2016, React Router will show a warning when you set <base>:
Warning: Automatically setting basename using <base href> is deprecated
and will be removed in the next major release. The semantics of <base href>
are subtly different from basename. Please pass the basename explicitly in the
options to createHistory
It’s better to do something like this instead:
const history = useRouterHistory(createHistory)({
basename: "https://stackoverflow.com/"
});