React-bootstrap Nav.Link

I am using react boostrap and I have ran into this issue where whenever I click on a link, I get 404 error.

I get no issue when I use react-router-dom and set my link like this About

With react-bootstrap I have set my link like this <Nav.Link href=‘about’>About</Nav.Link>
and that is where I am having the problem.

How do I get my nav links to work with react-bootstrap?


i think this might be helpful:

Let us know if not!

Hi Perry thanks for your response. I have done that and it works only when I do manual deploy by running netlify deploy…
However, I am using react and I don’t want to do manual deploys. I want to deploy from my github repo.
Now the problem is when I added the _redirects file to my published directory which is /build folder, it doesn’t work because when I pushed my code to github, the build folder which includes my _redirects file is automatically pushed to .gitignore.

Is there any work around here.

Hi, @samuel-antwi, do you have a public directory? If so, try adding the _redirects file there.

If this doesn’t work (or that directory doesn’t exist), please let us know.

I moved the redirects file to my public directory as you suggested and it works fine.
Thank you very much.

1 Like

great! that’s always a happy moment. glad its working now.