(element, props)
| 4482 | } |
| 4483 | |
| 4484 | function initWrapperState(element, props) { |
| 4485 | { |
| 4486 | ReactControlledValuePropTypes.checkPropTypes('input', props, getCurrentFiberStackAddendum); |
| 4487 | |
| 4488 | if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) { |
| 4489 | 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); |
| 4490 | didWarnCheckedDefaultChecked = true; |
| 4491 | } |
| 4492 | if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) { |
| 4493 | 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); |
| 4494 | didWarnValueDefaultValue = true; |
| 4495 | } |
| 4496 | } |
| 4497 | |
| 4498 | var node = element; |
| 4499 | var defaultValue = props.defaultValue == null ? '' : props.defaultValue; |
| 4500 | |
| 4501 | node._wrapperState = { |
| 4502 | initialChecked: props.checked != null ? props.checked : props.defaultChecked, |
| 4503 | initialValue: getSafeValue(props.value != null ? props.value : defaultValue), |
| 4504 | controlled: isControlled(props) |
| 4505 | }; |
| 4506 | } |
| 4507 | |
| 4508 | function updateChecked(element, props) { |
| 4509 | var node = element; |
no test coverage detected