MCPcopy Index your code
hub / github.com/microsoft/SandDance / initWrapperState

Function initWrapperState

docs/external/js/react-dom.development.js:1953–1977  ·  view source on GitHub ↗
(element, props)

Source from the content-addressed store, hash-verified

1951 return hostProps;
1952 }
1953 function initWrapperState(element, props) {
1954 {
1955 ReactControlledValuePropTypes.checkPropTypes('input', props);
1956
1957 if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
1958 error('%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);
1959
1960 didWarnCheckedDefaultChecked = true;
1961 }
1962
1963 if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
1964 error('%s contains an input of type %s with both value and defaultValue props. ' + 'Input 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 input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);
1965
1966 didWarnValueDefaultValue = true;
1967 }
1968 }
1969
1970 var node = element;
1971 var defaultValue = props.defaultValue == null ? '' : props.defaultValue;
1972 node._wrapperState = {
1973 initialChecked: props.checked != null ? props.checked : props.defaultChecked,
1974 initialValue: getToStringValue(props.value != null ? props.value : defaultValue),
1975 controlled: isControlled(props)
1976 };
1977 }
1978 function updateChecked(element, props) {
1979 var node = element;
1980 var checked = props.checked;

Callers 2

setInitialPropertiesFunction · 0.85
diffHydratedPropertiesFunction · 0.85

Calls 4

getToStringValueFunction · 0.85
errorFunction · 0.70
isControlledFunction · 0.70

Tested by

no test coverage detected