This problem becomes apparent when you try to host a react app in github pages.
How I fixed this,
In in my main application file, called app.tsx
, where I include the router.
I set the basename, eg,
<BrowserRouter basename="/Seans-TypeScript-ReactJS-Redux-Boilerplate/">
Note that it is a relative url, this completely simplifies the ability to run locally and hosted. The basename value, matches the repository title on GitHub. This is the path that GitHub pages will auto create.
That is all I needed to do.
See working example hosted on GitHub pages at
https://sean-bradley.github.io/Seans-TypeScript-ReactJS-Redux-Boilerplate/