MCPcopy Create free account
hub / github.com/plotly/dash / initWrapperState

Function initWrapperState

dash/deps/react-dom@18.3.1.js:1760–1784  ·  view source on GitHub ↗
(element, props)

Source from the content-addressed store, hash-verified

1758 return hostProps;
1759 }
1760 function initWrapperState(element, props) {
1761 {
1762 checkControlledValueProps('input', props);
1763
1764 if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
1765 error('%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://reactjs.org/link/controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);
1766
1767 didWarnCheckedDefaultChecked = true;
1768 }
1769
1770 if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
1771 error('%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://reactjs.org/link/controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);
1772
1773 didWarnValueDefaultValue = true;
1774 }
1775 }
1776
1777 var node = element;
1778 var defaultValue = props.defaultValue == null ? '' : props.defaultValue;
1779 node._wrapperState = {
1780 initialChecked: props.checked != null ? props.checked : props.defaultChecked,
1781 initialValue: getToStringValue(props.value != null ? props.value : defaultValue),
1782 controlled: isControlled(props)
1783 };
1784 }
1785 function updateChecked(element, props) {
1786 var node = element;
1787 var checked = props.checked;

Callers 2

setInitialPropertiesFunction · 0.70
diffHydratedPropertiesFunction · 0.70

Calls 5

errorFunction · 0.70
getToStringValueFunction · 0.70
isControlledFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…