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

Function initWrapperState$1

code/new-context-api/public/app.js:13937–13955  ·  view source on GitHub ↗
(element, props)

Source from the content-addressed store, hash-verified

13935}
13936
13937function initWrapperState$1(element, props) {
13938 var node = element;
13939 {
13940 checkSelectPropTypes(props);
13941 }
13942
13943 var value = props.value;
13944 node._wrapperState = {
13945 initialValue: value != null ? value : props.defaultValue,
13946 wasMultiple: !!props.multiple
13947 };
13948
13949 {
13950 if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue$1) {
13951 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');
13952 didWarnValueDefaultValue$1 = true;
13953 }
13954 }
13955}
13956
13957function postMountWrapper$2(element, props) {
13958 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