(element, props)
| 3715 | } |
| 3716 | |
| 3717 | function initWrapperState(element, props) { |
| 3718 | { |
| 3719 | ReactControlledValuePropTypes.checkPropTypes('input', props, getCurrentFiberStackAddendum); |
| 3720 | |
| 3721 | if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) { |
| 3722 | 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); |
| 3723 | didWarnCheckedDefaultChecked = true; |
| 3724 | } |
| 3725 | if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) { |
| 3726 | 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); |
| 3727 | didWarnValueDefaultValue = true; |
| 3728 | } |
| 3729 | } |
| 3730 | |
| 3731 | var node = element; |
| 3732 | var defaultValue = props.defaultValue == null ? '' : props.defaultValue; |
| 3733 | |
| 3734 | node._wrapperState = { |
| 3735 | initialChecked: props.checked != null ? props.checked : props.defaultChecked, |
| 3736 | initialValue: getSafeValue(props.value != null ? props.value : defaultValue), |
| 3737 | controlled: isControlled(props) |
| 3738 | }; |
| 3739 | } |
| 3740 | |
| 3741 | function updateChecked(element, props) { |
| 3742 | var node = element; |
no test coverage detected