Input element does not update the state

Tell us what’s happening:
I can not pass the test. Error message is:" Typing in the input element should update the state and the value of the input, and the

element should render this state as you type."

What am I missing in bellow code?

Your code so far

class ControlledInput extends React.Component {
constructor(props) {
  this.state = {
    input: ''
  // change code below this line
  // change code above this line
// change code below this line
handleChange(event) {

handleChange(event) {

// change code above this line
render() {
  return (
      { /* change code below this line */}
<input onChange = {this.handleChange.bind(this)}/>
      { /* change code above this line */}

      <h4>Controlled Input:</h4>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36.

Challenge: Create a Controlled Input

Link to the challenge:

I see two problems:

  1. You have two _ handleChange_ methods. You need to pick the right one.
  2. You input needs a value property.

When I make those changes, your code passes for me.

1 Like