taskorial icon indicating copy to clipboard operation
taskorial copied to clipboard

Site is re-rendered on opening the NavLinks

Open anmoljhamb opened this issue 2 years ago • 7 comments

Describe the bug Whenever a user clicks on the Navbar Links, i.e. Login and Sign Up, or even the redirection after the login and signup, the page gets re-rendered. We are using react-router-dom, so, we should use the features along with it. If we just wrap the text content in login and signup with the Link tag from react-router-dom, our website would no longer be re-rendered. And similarly, just use the useNavigate hook to redirect after a user is logged in, or signs up.

To Reproduce Steps to reproduce the behavior:

  1. Just click on a navbar link

Expected behavior The content of the routes should just be replaced, instead of the entire application, re-rendering.

anmoljhamb avatar Feb 19 '24 05:02 anmoljhamb