MCPcopy Index your code
hub / github.com/microsoft/SandDance / updateWrapper$1

Function updateWrapper$1

docs/external/js/react-dom.development.js:2536–2558  ·  view source on GitHub ↗
(element, props)

Source from the content-addressed store, hash-verified

2534 };
2535 }
2536 function updateWrapper$1(element, props) {
2537 var node = element;
2538 var value = getToStringValue(props.value);
2539 var defaultValue = getToStringValue(props.defaultValue);
2540
2541 if (value != null) {
2542 // Cast `value` to a string to ensure the value is set correctly. While
2543 // browsers typically do this as necessary, jsdom doesn't.
2544 var newValue = toString(value); // To avoid side effects (such as losing text selection), only set value if changed
2545
2546 if (newValue !== node.value) {
2547 node.value = newValue;
2548 }
2549
2550 if (props.defaultValue == null && node.defaultValue !== newValue) {
2551 node.defaultValue = newValue;
2552 }
2553 }
2554
2555 if (defaultValue != null) {
2556 node.defaultValue = toString(defaultValue);
2557 }
2558 }
2559 function postMountWrapper$3(element, props) {
2560 var node = element; // This is in postMount because we need access to the DOM node, which is not
2561 // available until after the component has mounted.

Callers 2

restoreControlledState$2Function · 0.85
updatePropertiesFunction · 0.85

Calls 2

getToStringValueFunction · 0.85
toStringFunction · 0.70

Tested by

no test coverage detected