Getting page not forund when returning to page after submitting a form

I have a Netlify-form in my react jsx website. my form will submit the data to netlify and i get the thank you message, but when i click back to page i get error 404 page not found. In addition, when i run my site locally i get Cannot POST/name of page and an error 404 in the console. i dont know if this has anything to do with the first problem.

i have tried to add an action field to the form to get past the thank you page from netlify but does not work either.

my code is below:

the form in my react component is the provided image
Screenshot 2022-09-16 at 15.26.21
:

the name of the form will be one of four

Hello @formMan , thanks for posting.

Based on my research regarding your problem, It’s possible you’re using React Router.
If that’s the case try creating a _redirects file in the public folder with the content below.

/* /index.html 200

Once you are done redeploy and let me know if it works.
If the above is not the case kindly provide a repository of the site you are trying to deploy for me to help with the debugging.

Thanks.