I would like to know how to fix the following error:
onChange={this.handleName}
I am aware that I should make the binding inside the constructor and also I cannot make the binding inside the onChange, any ideas?
class Register extends React.Component {
constructor(props: Props) {
super(props)
this.state = {
name: '',
surname: '',
email: '',
}
}
handleName(e) {
this.setState({ name: e.target.value })
}
render() {
return (
<Dialog className={classes.root} open={isOpen}>
<TextField label="NAME" onChange={this.handleName} fullWidth />
</Dialog>
)
}
}