Is there a way to redirect to a different url using Link to? This is the code I have written:
let obj = { key: 'google', title: 'Google link', link: 'www.google.com' }
let obj2 = { key: 'about', title: 'About', link: '/about' }
<Link target={obj.key === 'google' ? '_blank' : ''} to={obj.link}>{obj.title}</Link>
Here when I pass obj2 to Link ,it works as expected. From my current page (http://localhost:5000/contactus), it is navigated to http://localhost:5000/contactus page. I also want to redirect to 'www.google.com' but when I do that, it's redirecting to http://localhost:5000/www.google.com. Link to is building upon the parent url. I need it to link to google directly. How do I do it?