(element, props)
| 4575 | } |
| 4576 | |
| 4577 | function initWrapperState(element, props) { |
| 4578 | { |
| 4579 | ReactControlledValuePropTypes.checkPropTypes('input', props, getCurrentFiberStackAddendum); |
| 4580 | |
| 4581 | if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) { |
| 4582 | 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); |
| 4583 | didWarnCheckedDefaultChecked = true; |
| 4584 | } |
| 4585 | if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) { |
| 4586 | 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); |
| 4587 | didWarnValueDefaultValue = true; |
| 4588 | } |
| 4589 | } |
| 4590 | |
| 4591 | var node = element; |
| 4592 | var defaultValue = props.defaultValue == null ? '' : props.defaultValue; |
| 4593 | |
| 4594 | node._wrapperState = { |
| 4595 | initialChecked: props.checked != null ? props.checked : props.defaultChecked, |
| 4596 | initialValue: getSafeValue(props.value != null ? props.value : defaultValue), |
| 4597 | controlled: isControlled(props) |
| 4598 | }; |
| 4599 | } |
| 4600 | |
| 4601 | function updateChecked(element, props) { |
| 4602 | var node = element; |
no test coverage detected