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

Function updateWrapper$1

code/third-party/public/app.js:13952–13971  ·  view source on GitHub ↗
(element, props)

Source from the content-addressed store, hash-verified

13950}
13951
13952function updateWrapper$1(element, props) {
13953 var node = element;
13954 var value = props.value;
13955 if (value != null) {
13956 // Cast `value` to a string to ensure the value is set correctly. While
13957 // browsers typically do this as necessary, jsdom doesn't.
13958 var newValue = '' + value;
13959
13960 // To avoid side effects (such as losing text selection), only set value if changed
13961 if (newValue !== node.value) {
13962 node.value = newValue;
13963 }
13964 if (props.defaultValue == null) {
13965 node.defaultValue = newValue;
13966 }
13967 }
13968 if (props.defaultValue != null) {
13969 node.defaultValue = props.defaultValue;
13970 }
13971}
13972
13973function postMountWrapper$3(element, props) {
13974 var node = element;

Callers 2

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

Calls

no outgoing calls

Tested by

no test coverage detected