React Forms

Update an Input's Value

When a user types or deletes in the <input />, then that will trigger a change event, which will call handleUserInput. That's good!

handleUserInput will set this.state.userInput equal to whatever text is currently in the input field. That's also good!

There's only one problem: you can set this.state.userInput to whatever you want, but <input /> won't care. You need to somehow make the <input />'s text responsive to this.state.userInput.

Easy enough! You can control an <input />'s text by setting its value attribute.

Community Forums
Get help and ask questions in the Codecademy Forums
Report a Bug
If you see a bug or any other issue with this page, please report it here.