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

Function updateWrapper$1

code/dependency-injection/public/app.js:14812–14831  ·  view source on GitHub ↗
(element, props)

Source from the content-addressed store, hash-verified

14810}
14811
14812function updateWrapper$1(element, props) {
14813 var node = element;
14814 var value = props.value;
14815 if (value != null) {
14816 // Cast `value` to a string to ensure the value is set correctly. While
14817 // browsers typically do this as necessary, jsdom doesn't.
14818 var newValue = '' + value;
14819
14820 // To avoid side effects (such as losing text selection), only set value if changed
14821 if (newValue !== node.value) {
14822 node.value = newValue;
14823 }
14824 if (props.defaultValue == null) {
14825 node.defaultValue = newValue;
14826 }
14827 }
14828 if (props.defaultValue != null) {
14829 node.defaultValue = props.defaultValue;
14830 }
14831}
14832
14833function postMountWrapper$3(element, props) {
14834 var node = element;

Callers 2

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

Calls

no outgoing calls

Tested by

no test coverage detected