(element, props)
| 4476 | } |
| 4477 | |
| 4478 | function initWrapperState(element, props) { |
| 4479 | { |
| 4480 | ReactControlledValuePropTypes.checkPropTypes('input', props, getCurrentFiberStackAddendum); |
| 4481 | |
| 4482 | if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) { |
| 4483 | warning(false, '%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', getCurrentFiberOwnerName() || 'A component', props.type); |
| 4484 | didWarnCheckedDefaultChecked = true; |
| 4485 | } |
| 4486 | if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) { |
| 4487 | warning(false, '%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', getCurrentFiberOwnerName() || 'A component', props.type); |
| 4488 | didWarnValueDefaultValue = true; |
| 4489 | } |
| 4490 | } |
| 4491 | |
| 4492 | var node = element; |
| 4493 | var defaultValue = props.defaultValue == null ? '' : props.defaultValue; |
| 4494 | |
| 4495 | node._wrapperState = { |
| 4496 | initialChecked: props.checked != null ? props.checked : props.defaultChecked, |
| 4497 | initialValue: getSafeValue(props.value != null ? props.value : defaultValue), |
| 4498 | controlled: isControlled(props) |
| 4499 | }; |
| 4500 | } |
| 4501 | |
| 4502 | function updateChecked(element, props) { |
| 4503 | var node = element; |
no test coverage detected