React: Create a Controlled Input - Please Help

Hi FCC people! i’m getting this error on this lesson:

// running tests

Typing in the input element should update the state and the value of the input, and the p element should render this state as you type.

// tests completed

I don’t know why this is happening, this is my code:

class ControlledInput extends React.Component {
constructor(props) {
super(props);
this.state = {
input: ‘’
};
// change code below this line
this.handleChange = this.handleChange.bind (this)
// change code above this line
}
// change code below this line
handleChange(event){

  this.setState({
    imput: event.target.value
  })


}

// change code above this line
render() {
return (


{ /* change code below this line */}
    <input value={this.state.input} onChange={this.handleChange} />
    


    { /* change code above this line */}
    <h4>Controlled Input:</h4>
    <p>{this.state.input}</p>
  </div>
);

}
};

Thanks in advance for anyone that can help me understand what is going on

It is input not imput

2 Likes

That was the problem, thank you very much!

1 Like