In my log in page I have a button \"Forget my password\", I need, when I click in this button to go to the correct page.
In my current code, when I clic
Please try this example:
import React from "react";
export default class Login extends React.Component {
constructor(props) {
super(props);
this.state = {forgot: false};
}
login() {
alert('Login will work here');
}
forgot() {
this.setState({forgot: true})
}
render() {
return (
{this.state.forgot === false &&
Username:
Password:
}
{this.state.forgot === true && }
);
}
}
class ForgotPassword extends React.Component {
reset() {
alert('Password is sent to your email');
}
render() {
return (Write your email
)
}
}