(element, props)
| 4355 | } |
| 4356 | |
| 4357 | function initWrapperState(element, props) { |
| 4358 | { |
| 4359 | ReactControlledValuePropTypes.checkPropTypes('input', props, getCurrentFiberStackAddendum); |
| 4360 | |
| 4361 | if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) { |
| 4362 | 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); |
| 4363 | didWarnCheckedDefaultChecked = true; |
| 4364 | } |
| 4365 | if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) { |
| 4366 | 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); |
| 4367 | didWarnValueDefaultValue = true; |
| 4368 | } |
| 4369 | } |
| 4370 | |
| 4371 | var node = element; |
| 4372 | var defaultValue = props.defaultValue == null ? '' : props.defaultValue; |
| 4373 | |
| 4374 | node._wrapperState = { |
| 4375 | initialChecked: props.checked != null ? props.checked : props.defaultChecked, |
| 4376 | initialValue: getSafeValue(props.value != null ? props.value : defaultValue), |
| 4377 | controlled: isControlled(props) |
| 4378 | }; |
| 4379 | } |
| 4380 | |
| 4381 | function updateChecked(element, props) { |
| 4382 | var node = element; |
no test coverage detected