heroku 배포 후, '/' 가 아닌 곳에서 새로고침 또는 뒤로가기시 React에서 404 에러가 발생하였다.
stackoverflow에서 해결방법을 찾을 수 있었다.
root 폴더에 static.json을 추가하는 것으로 문제가 해결되었다.
{
"root": "build/",
"clean_urls": false,
"routes": {
"/**": "index.html"
}
}
✨ 참고
https://stackoverflow.com/questions/41772411/react-routing-works-in-local-machine-but-not-heroku