This is the frontend repo of Uni-forum, associated with the University of Auckland, SOFTENG701. This repo will be linked to Netlify for ease of deployment and code review
MIT License
1
stars
22
forks
source link
Replace <a href/> inside Login and Register pages to use the useNavigate() hook from react-router-dom #50
Replace <a href/> inside Login, password-reset and Register pages to use the useNavigate() hook from react-router-dom
Why?
Although this method works, it refreshes the page which may degrade the user experience. By using the useNavigate( ) hook it will use the SPA (single page application) routing features.
For example:
On line 74 in the image above the a tag needs to be removed and instead add an onclick on line 75 and inside an anonymous function use navigate("/register") from useNavigate( )'s return value.
Replace
<a href/>
inside Login, password-reset and Register pages to use the useNavigate() hook from react-router-domWhy?
Although this method works, it refreshes the page which may degrade the user experience. By using the useNavigate( ) hook it will use the SPA (single page application) routing features.
For example: On line 74 in the image above the a tag needs to be removed and instead add an onclick on line 75 and inside an anonymous function use navigate("/register") from useNavigate( )'s return value.