React · Junior · Question 21 of 75

React warns: "You provided a value prop to a form field without an onChange handler". What happened?

Explanation

If you set value without onChange, React resets the field to that value on every render, and the user can't type. Fixes: add onChange, use defaultValue for an uncontrolled field, or set readOnly explicitly.

Further reading

Problem with a question

React · Junior · question 21

Test yourself

Take the React · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz