MCPcopy Index your code
hub / github.com/reactjs/react-rails / initWrapperState

Function initWrapperState

lib/assets/react-source/development/react.js:5525–5549  ·  view source on GitHub ↗
(element, props)

Source from the content-addressed store, hash-verified

5523 return hostProps;
5524 }
5525 function initWrapperState(element, props) {
5526 {
5527 ReactControlledValuePropTypes.checkPropTypes('input', props);
5528
5529 if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
5530 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);
5531
5532 didWarnCheckedDefaultChecked = true;
5533 }
5534
5535 if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
5536 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);
5537
5538 didWarnValueDefaultValue = true;
5539 }
5540 }
5541
5542 var node = element;
5543 var defaultValue = props.defaultValue == null ? '' : props.defaultValue;
5544 node._wrapperState = {
5545 initialChecked: props.checked != null ? props.checked : props.defaultChecked,
5546 initialValue: getToStringValue(props.value != null ? props.value : defaultValue),
5547 controlled: isControlled(props)
5548 };
5549 }
5550 function updateChecked(element, props) {
5551 var node = element;
5552 var checked = props.checked;

Callers 2

setInitialPropertiesFunction · 0.85
diffHydratedPropertiesFunction · 0.85

Calls 4

getToStringValueFunction · 0.85
isControlledFunction · 0.85
errorFunction · 0.70

Tested by

no test coverage detected