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

Function updateWrapper$1

code/composition/public/app.js:14857–14876  ·  view source on GitHub ↗
(element, props)

Source from the content-addressed store, hash-verified

14855}
14856
14857function updateWrapper$1(element, props) {
14858 var node = element;
14859 var value = props.value;
14860 if (value != null) {
14861 // Cast `value` to a string to ensure the value is set correctly. While
14862 // browsers typically do this as necessary, jsdom doesn't.
14863 var newValue = '' + value;
14864
14865 // To avoid side effects (such as losing text selection), only set value if changed
14866 if (newValue !== node.value) {
14867 node.value = newValue;
14868 }
14869 if (props.defaultValue == null) {
14870 node.defaultValue = newValue;
14871 }
14872 }
14873 if (props.defaultValue != null) {
14874 node.defaultValue = props.defaultValue;
14875 }
14876}
14877
14878function postMountWrapper$3(element, props) {
14879 var node = element;

Callers 2

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

Calls

no outgoing calls

Tested by

no test coverage detected