function EmailField() {
return <input type="email" value="[email protected]" />;
}What happens when a user tries to edit this field in the browser?
- aIt updates normally on every keystroke, but the parent component never re-renders because of it.
- bReact throws a synchronous render error, and the whole component tree unmounts immediately.
- cThe field behaves as read-only, and React logs a dev warning about a missing onChange handler.✓
- dReact silently converts the field into an uncontrolled input the first time a key is pressed.
Explanation:A
value prop makes an input controlled by React, and there's no onChange to feed a new value back in, so React keeps pinning the displayed text to "[email protected]" no matter what is typed — the field is effectively read-only. React also logs: "You provided a value prop to a form field without an onChange handler. This will render a read-only field." Fix by adding onChange, using readOnly explicitly, or switching to defaultValue for an uncontrolled field.