what is the difference between html tag \"/href\" and navlink provided by react-router to navigate the page? I can use both in order to navigate page to the different URL, s
If we were to create links using anchor elements such as href
, clicking on them would cause the whole page to reload. React Router provides a component to prevent that from happening. When clicking a
, the URL will be updated and the rendered content will change without reloading the page. So basically to sum up this
navlink/ link provided by react doesnt refresh the page while href refreshes the page