validateInputProps() — react Function Reference
Architecture documentation for the validateInputProps() function in ReactDOMInput.js from the react codebase.
Entity Profile
Dependency Diagram
graph TD 7fde30c4_2df7_4194_0c3e_083dd0f57c00["validateInputProps()"] ebd36fdb_cc70_52b6_9971_bcace1958602["ReactDOMInput.js"] 7fde30c4_2df7_4194_0c3e_083dd0f57c00 -->|defined in| ebd36fdb_cc70_52b6_9971_bcace1958602 96cf114b_9b89_b174_432c_1584a973fcdd["setInitialProperties()"] 96cf114b_9b89_b174_432c_1584a973fcdd -->|calls| 7fde30c4_2df7_4194_0c3e_083dd0f57c00 894d4888_e1c9_cdd6_e0cb_7451b6fba151["hydrateProperties()"] 894d4888_e1c9_cdd6_e0cb_7451b6fba151 -->|calls| 7fde30c4_2df7_4194_0c3e_083dd0f57c00 style 7fde30c4_2df7_4194_0c3e_083dd0f57c00 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/react-dom-bindings/src/client/ReactDOMInput.js lines 47–87
export function validateInputProps(element: Element, props: Object) {
if (__DEV__) {
// Normally we check for undefined and null the same, but explicitly specifying both
// properties, at all is probably worth warning for. We could move this either direction
// and just make it ok to pass null or just check hasOwnProperty.
if (
props.checked !== undefined &&
props.defaultChecked !== undefined &&
!didWarnCheckedDefaultChecked
) {
console.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://react.dev/link/controlled-components',
getCurrentFiberOwnerNameInDevOrNull() || 'A component',
props.type,
);
didWarnCheckedDefaultChecked = true;
}
if (
props.value !== undefined &&
props.defaultValue !== undefined &&
!didWarnValueDefaultValue
) {
console.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://react.dev/link/controlled-components',
getCurrentFiberOwnerNameInDevOrNull() || 'A component',
props.type,
);
didWarnValueDefaultValue = true;
}
}
}
Domain
Subdomains
Source
Frequently Asked Questions
What does validateInputProps() do?
validateInputProps() is a function in the react codebase, defined in packages/react-dom-bindings/src/client/ReactDOMInput.js.
Where is validateInputProps() defined?
validateInputProps() is defined in packages/react-dom-bindings/src/client/ReactDOMInput.js at line 47.
What calls validateInputProps()?
validateInputProps() is called by 2 function(s): hydrateProperties, setInitialProperties.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free