jeudi 25 novembre 2021

How to Navigate to separate URL in react router Dom v6?

i am making a validation form , with a function that checks for password and email , if true it should navigate to a separate website (not to a path within the web). But it is not working

This is my code below:

function validate() {
    if (email==='123@123.com' && password==="123456"){
        console.log(email);
 history('http://www.dummy.com/webmail')
}
}

return{
.
.
.
<Button className={stylesAuth.submitButton} variant="warning" onClick={validate}>
}

How should I do so?




Aucun commentaire:

Enregistrer un commentaire