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

Function initWrapperState$1

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

Source from the content-addressed store, hash-verified

14574}
14575
14576function initWrapperState$1(element, props) {
14577 var node = element;
14578 {
14579 checkSelectPropTypes(props);
14580 }
14581
14582 var value = props.value;
14583 node._wrapperState = {
14584 initialValue: value != null ? value : props.defaultValue,
14585 wasMultiple: !!props.multiple
14586 };
14587
14588 {
14589 if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue$1) {
14590 warning(false, 'Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components');
14591 didWarnValueDefaultValue$1 = true;
14592 }
14593 }
14594}
14595
14596function postMountWrapper$2(element, props) {
14597 var node = element;

Callers 2

setInitialProperties$1Function · 0.70
diffHydratedProperties$1Function · 0.70

Calls 2

warningFunction · 0.85
checkSelectPropTypesFunction · 0.70

Tested by

no test coverage detected