mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-25 23:05:23 +00:00
644 B
644 B
id, title, layout, permalink
| id | title | layout | permalink |
|---|---|---|---|
| controlled-input-null-value | Value of null for controlled input | docs | controlled-input-null-value.html |
Problem
You specified a value parameter for your form input, but the input value can still be modified, contrary to what you'd expect.
Solution
You might have accidentally set value to undefined or null. The snippet below shows this phenomenon; after a second, the text becomes editable.
/** @jsx React.DOM */
React.renderComponent(<input value="hi" />, mountNode);
setTimeout(function() {
React.renderComponent(<input value={null} />, mountNode);
}, 2000);