404 error when reloading reactjs site deployed on github pages

I recently deployed a reactjs website on github pages using the custom domain -https://titanmarket.co.ke/ .

The website works as expected but returns a 404 error when you reload a page.Usually, a user would expect the current page to be displayed on refresh.

Any insight on this would be great.

P.S. I’ve spent tons of hours trying to get a solution on Stackoverflow. Most of the solutions assume that I am using a Node.js back end which is not the case.