Surge-deployed React app - getting 404 Page Not Found
You can't access your routes directly. you have to do this little hack for that.
- After you run the
npm run build
command you have to go to the build folder of your react application folder. - Take a copy of index.html file. then past it in the same place and rename it as 200.html now it will work as we wish. This is all for today.
read more about this issue: here
Change your build step in package.json
"build": "react-scripts build && cp build/index.html build/200.html"
Source: https://medium.com/superhighfives/serving-client-side-routing-with-surge-sh-7b705542cf3
Follow below step to resolve(only 4 surge):
npm run build
cd build
cp index.html 200.html
surge
From here you can continue as usual