尝试在注册时将用户导航到不同的网站
handleSubmit = () => {
code
if(registered){
Navigate to external link
}
}
我正在尝试使用<Link to={{ pathname: 'res.data.storeRegistrationLink' }}/>
但它不起作用。
最佳答案
试试这个,如果您遇到任何问题请告诉我。 在这里,当我编写 window.location 时,您也可以使用 window.location.replace,因为它允许用户返回到重定向他们的路由。
handleSubmit = () => { if(registered){ window.location.href = 'https://google.com'; }}
关于reactjs - 导航到react js中的外部链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72864289/