Netlify has made it easy to deploy react projects for free, amazing right?.
When I first tried to deploy an app with a router I came across a slight obstacle, this was an easily solved issue but at that moment, it was a little hard for me to get through it.
This article is to help the next newbie that might come across such issues.
The solution to getting your routing to work on Netlify lies in one file, the netlify.toml file. This is the netlify configuration file, for mor information on this check here.
All you have to do is create a netlify.toml file in your root folder and inside the file include this code:
This will catch all the redirects and your React app should work just fine.
You can run npm build and manually upload your files or link it to your GitHub/Gitlab/Bithub repository and netlify will handle the continuous integration for your app(i.e all new changes pushed to your repository will be reflected online without you having to rebuild the app)
I hope this article helps someone and if you have any inquiries or questions you can leave a comment, thank you.