(element, props)
| 3806 | } |
| 3807 | |
| 3808 | function initWrapperState(element, props) { |
| 3809 | { |
| 3810 | ReactControlledValuePropTypes.checkPropTypes('input', props, getCurrentFiberStackAddendum); |
| 3811 | |
| 3812 | if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) { |
| 3813 | 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); |
| 3814 | didWarnCheckedDefaultChecked = true; |
| 3815 | } |
| 3816 | if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) { |
| 3817 | 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); |
| 3818 | didWarnValueDefaultValue = true; |
| 3819 | } |
| 3820 | } |
| 3821 | |
| 3822 | var node = element; |
| 3823 | var defaultValue = props.defaultValue == null ? '' : props.defaultValue; |
| 3824 | |
| 3825 | node._wrapperState = { |
| 3826 | initialChecked: props.checked != null ? props.checked : props.defaultChecked, |
| 3827 | initialValue: getSafeValue(props.value != null ? props.value : defaultValue), |
| 3828 | controlled: isControlled(props) |
| 3829 | }; |
| 3830 | } |
| 3831 | |
| 3832 | function updateChecked(element, props) { |
| 3833 | var node = element; |
no test coverage detected