If you are hosting you React APP on Apache server, and if the routing works fine locally but not on server and you encouter the following problems on your server.
- cannot refresh page
- cannot directly input the url
Then, you need to config .htaccess on your server.
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]
RewriteRule ^ /index.html [L]