Page not found on direct routing to specific component

I have a react project deployed in netlify if i navigate through my app using links i can go to that path but if i directly go to that url it says page not found hoe to deploy such apps


when i tyr to directly search by same url i get page not found

@Sudip-khadka What you’re seeking is referenced in the yellow warning box here in the documentation:

https://docs.netlify.com/configure-builds/javascript-spas/

Avoid 404s for SPAs
If your project is a single page app (SPA) that uses the history pushState method to get clean URLs, you must add a rewrite rule to serve the index.html file no matter what URL the browser requests.

The applicable rewrite rule is outlined when following the link:
https://docs.netlify.com/routing/redirects/rewrites-proxies/#history-pushstate-and-single-page-apps

Create either a _redirects file or netlify.toml and apply the appropriate rule:

_redirects

/*  /index.html  200

netlify.toml

[[redirects]]
  from = "/*"
  to = "/index.html"
  status = 200