useNavigate: Navigate to external Link

Viewed 1790

on Clicking of a button, I want to perform an async operation and after that navigate user to an external website as shown below:

navigate("https://wwww.google.com?q=ABC")

But here's the problem:

while using navigate, my url changes like this, because for some reason it's assuming relative path:

http://localhost:3000/https://wwww.google.com?q=ABC

Can someone help me understand what is going wrong? I also tried setting replace to true but no luck there as well.

1 Answers
window.location.href = "https://wwww.google.com?q=ABC";
Related