The most popular ones are location.href and location.replace: Note: The difference between href and replace, is that replace() removes the URL of the current document from the document history, meaning that it is not possible to use the "back" button to navigate back to the original document. Could very old employee stock options still be accessible and viable? The href attribute of the location object is used to get the web page address (URL) you are visiting. Launching the CI/CD and R Collectives and community editing features for How can I validate an email address in JavaScript? There are a couple of ways to redirect to another webpage with JavaScript. Because useNavigate() is a hook built into the React-router-dom library for custom page navigation, in this way, we will make full use of this method, but to run it first, we have to install the react-router-dom library.. Terminal: npm i react-router-dom. Hope all solution helped you a lot. Its all Aboutthis issue. Another option and just to take advantage of the native link component without using the Button component, is to use the bootstrap classes(which support styling a tags as a button): Thanks for contributing an answer to Stack Overflow! You would need to use bootstrap