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

Function initWrapperState$1

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

Source from the content-addressed store, hash-verified

14712}
14713
14714function initWrapperState$1(element, props) {
14715 var node = element;
14716 {
14717 checkSelectPropTypes(props);
14718 }
14719
14720 var value = props.value;
14721 node._wrapperState = {
14722 initialValue: value != null ? value : props.defaultValue,
14723 wasMultiple: !!props.multiple
14724 };
14725
14726 {
14727 if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue$1) {
14728 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');
14729 didWarnValueDefaultValue$1 = true;
14730 }
14731 }
14732}
14733
14734function postMountWrapper$2(element, props) {
14735 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