Tell us what’s happening:
How is this code below not satisfying the required condition?
class ControlledInput extends React.Component {
constructor(props) {
super(props);
this.state = {
input: '',
};
}
handleChange(event) {
this.setState({ input: event.target.value });
};
render(event) {
return (
<div>
<input type="input" onChange=
{this.handleChange.bind(this)}
placeholder="Enter your name" />
<h1>{this.state.input}</h1>
<p ControlledInput />
</div>
);
}
}
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36
.
Challenge: Create a Controlled Input
Link to the challenge: