MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / updateWrapper$1

Function updateWrapper$1

code/one-direction-data-flow/public/app.js:14592–14611  ·  view source on GitHub ↗
(element, props)

Source from the content-addressed store, hash-verified

14590}
14591
14592function updateWrapper$1(element, props) {
14593 var node = element;
14594 var value = props.value;
14595 if (value != null) {
14596 // Cast `value` to a string to ensure the value is set correctly. While
14597 // browsers typically do this as necessary, jsdom doesn't.
14598 var newValue = '' + value;
14599
14600 // To avoid side effects (such as losing text selection), only set value if changed
14601 if (newValue !== node.value) {
14602 node.value = newValue;
14603 }
14604 if (props.defaultValue == null) {
14605 node.defaultValue = newValue;
14606 }
14607 }
14608 if (props.defaultValue != null) {
14609 node.defaultValue = props.defaultValue;
14610 }
14611}
14612
14613function postMountWrapper$3(element, props) {
14614 var node = element;

Callers 2

restoreControlledState$3Function · 0.70
updateProperties$1Function · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected