Tell us what’s happening:
Why the last one is not passing the tes.
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.

Your code so far

class ControlledInput extends React.Component {
  constructor(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(e) {
  // change code above this line
  render() {
    return (
        { /* change code below this line */}
        <input type="text" onChange={this.handleChange} value={this.state.value} />
        { /* change code above this line */}
        <h4>Controlled Input:{this.state.input}</h4>

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36.

Link to the challenge:


Finally!, I am able to crack the challenge

<input type="text" onChange={this.handleChange} value={this.state.input} />


Thanks! I just had the same issue and this fixed it. It could be more directly mentioned in the lesson instruction.


I had the same issue! many thanks @Randore


Cool, it helps me pass the test. But I have one question here:


Why we don’t need a parameter for handleChange here? Since the method handleChange needs one parameter when it is defined. Please help me with this.