Why should I control input value?

in this lesson

  • why should I set the input value to the userInput property
    i.e. if i’ve just set userInput equal to e.target.value in the setState function shouldn’t this do it when i set the h1 tag innertext to userInput…?
    then why do i need to set also the input value property again to userInput…
1 Like

Hi Susano,

you should set input’s value attribute to control an <input /> ‘s text and make it responsive to this.state.userInput .