Skip to content

Commit

Permalink
Do not eagerly stringify value
Browse files Browse the repository at this point in the history
  • Loading branch information
nhunzaker authored and gaearon committed Sep 12, 2018
1 parent 30752e1 commit 7bc5f44
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react-dom/src/client/ReactDOMInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ export function postMountWrapper(
// When not syncing the value attribute, the value property points
// directly to the React prop. Only assign it if it exists.
if (props.hasOwnProperty('value')) {
const value = toString(getToStringValue(props.value));
const value = getToStringValue(props.value);

// Always assign on buttons so that it is possible to assign an
// empty string to clear button text.
Expand All @@ -272,7 +272,7 @@ export function postMountWrapper(
// to the current value in case the browser provided value is not an
// empty string.
if (isButton || value !== node.value) {
node.value = value;
node.value = toString(value);
}
}
} else {
Expand Down

0 comments on commit 7bc5f44

Please sign in to comment.