To avoid 404 error, and to redirect all the requests to index.html
create an _redirects file in the root of the deployed folder with the content:
/* /index.html 200netlify.toml:
[build]
# Directory to change to before starting a build.
# This is where we will look for package.json/.nvmrc/etc.
# If not set, defaults to the root directory.
base = "/"
publish = "build"
command = "npm run build"
# The following redirect is intended for use with most SPAs that handle
# routing internally.
[[redirects]]
from = "/*"
to = "/index.html"
status = 200