(element, props)
| 3843 | } |
| 3844 | |
| 3845 | function initWrapperState(element, props) { |
| 3846 | { |
| 3847 | ReactControlledValuePropTypes.checkPropTypes('input', props, getCurrentFiberStackAddendum); |
| 3848 | |
| 3849 | if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) { |
| 3850 | 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); |
| 3851 | didWarnCheckedDefaultChecked = true; |
| 3852 | } |
| 3853 | if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) { |
| 3854 | 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); |
| 3855 | didWarnValueDefaultValue = true; |
| 3856 | } |
| 3857 | } |
| 3858 | |
| 3859 | var node = element; |
| 3860 | var defaultValue = props.defaultValue == null ? '' : props.defaultValue; |
| 3861 | |
| 3862 | node._wrapperState = { |
| 3863 | initialChecked: props.checked != null ? props.checked : props.defaultChecked, |
| 3864 | initialValue: getSafeValue(props.value != null ? props.value : defaultValue), |
| 3865 | controlled: isControlled(props) |
| 3866 | }; |
| 3867 | } |
| 3868 | |
| 3869 | function updateChecked(element, props) { |
| 3870 | var node = element; |
no test coverage detected