Confused in Create a Controlled Input challenge

Tell us what’s happening:
Hey guys, I don’t get why this is saying that event is undefined…
Your code so far


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({
    input: event.target.value
  });
}
// Change code above this line
render() {
  return (
    <div>
      { /* 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>
  );
}
};
  **Your browser information:**

User Agent is: Mozilla/5.0 (X11; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0.

Challenge: Create a Controlled Input

Link to the challenge:

onChange={this.handleChange()}

Should be passed in with no parenthesis.

onChange={this.handleChange}

ooooo…Thanks man!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.