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

Function updateWrapper$1

code/styling/public/app.js:14719–14738  ·  view source on GitHub ↗
(element, props)

Source from the content-addressed store, hash-verified

14717}
14718
14719function updateWrapper$1(element, props) {
14720 var node = element;
14721 var value = props.value;
14722 if (value != null) {
14723 // Cast `value` to a string to ensure the value is set correctly. While
14724 // browsers typically do this as necessary, jsdom doesn't.
14725 var newValue = '' + value;
14726
14727 // To avoid side effects (such as losing text selection), only set value if changed
14728 if (newValue !== node.value) {
14729 node.value = newValue;
14730 }
14731 if (props.defaultValue == null) {
14732 node.defaultValue = newValue;
14733 }
14734 }
14735 if (props.defaultValue != null) {
14736 node.defaultValue = props.defaultValue;
14737 }
14738}
14739
14740function postMountWrapper$3(element, props) {
14741 var node = element;

Callers 2

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

Calls

no outgoing calls

Tested by

no test coverage detected