Like I mentioned in the comment, you can't use <BrowserHistory>
when you host in a static site. You need a mechanism to redirect all URLs to your index.html so react-router will take over.
To Achieve this you will need some server-side code and hosting for the same. S3 won't work as it can handle only static files. If S3 is the only option, use or there is a hack mentioned [here][1]. I won't recommend it but there is one.
If you are planning to use server-side code here is an example of how NodeJs Express can be used to get the routing work,
app.use(express.static(path.join(__dirname, 'dist')));
app.get('*', function(req, res) {
res.sendfile('./dist/index.html');
});
assuming your build is in the dist folder.
[1]: react router doesn't work in aws s3 bucket
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…