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

Function updateWrapper$1

code/communication/public/app.js:14754–14773  ·  view source on GitHub ↗
(element, props)

Source from the content-addressed store, hash-verified

14752}
14753
14754function updateWrapper$1(element, props) {
14755 var node = element;
14756 var value = props.value;
14757 if (value != null) {
14758 // Cast `value` to a string to ensure the value is set correctly. While
14759 // browsers typically do this as necessary, jsdom doesn't.
14760 var newValue = '' + value;
14761
14762 // To avoid side effects (such as losing text selection), only set value if changed
14763 if (newValue !== node.value) {
14764 node.value = newValue;
14765 }
14766 if (props.defaultValue == null) {
14767 node.defaultValue = newValue;
14768 }
14769 }
14770 if (props.defaultValue != null) {
14771 node.defaultValue = props.defaultValue;
14772 }
14773}
14774
14775function postMountWrapper$3(element, props) {
14776 var node = element;

Callers 2

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

Calls

no outgoing calls

Tested by

no test coverage detected