(element, props)
| 4733 | } |
| 4734 | |
| 4735 | function initWrapperState(element, props) { |
| 4736 | { |
| 4737 | ReactControlledValuePropTypes.checkPropTypes('input', props, getCurrentFiberStackAddendum); |
| 4738 | |
| 4739 | if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) { |
| 4740 | 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); |
| 4741 | didWarnCheckedDefaultChecked = true; |
| 4742 | } |
| 4743 | if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) { |
| 4744 | 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); |
| 4745 | didWarnValueDefaultValue = true; |
| 4746 | } |
| 4747 | } |
| 4748 | |
| 4749 | var node = element; |
| 4750 | var defaultValue = props.defaultValue == null ? '' : props.defaultValue; |
| 4751 | |
| 4752 | node._wrapperState = { |
| 4753 | initialChecked: props.checked != null ? props.checked : props.defaultChecked, |
| 4754 | initialValue: getSafeValue(props.value != null ? props.value : defaultValue), |
| 4755 | controlled: isControlled(props) |
| 4756 | }; |
| 4757 | } |
| 4758 | |
| 4759 | function updateChecked(element, props) { |
| 4760 | var node = element; |
no test coverage detected