Home / Function/ validateProperties() — react Function Reference

validateProperties() — react Function Reference

Architecture documentation for the validateProperties() function in ReactDOMNullInputValuePropHook.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  5d4cfab2_9f35_5769_4ee5_fc6746ffb1c1["validateProperties()"]
  b67411db_4c43_ad15_a175_b780c7f60ac2["ReactDOMNullInputValuePropHook.js"]
  5d4cfab2_9f35_5769_4ee5_fc6746ffb1c1 -->|defined in| b67411db_4c43_ad15_a175_b780c7f60ac2
  style 5d4cfab2_9f35_5769_4ee5_fc6746ffb1c1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-dom-bindings/src/shared/ReactDOMNullInputValuePropHook.js lines 10–35

export function validateProperties(type, props) {
  if (__DEV__) {
    if (type !== 'input' && type !== 'textarea' && type !== 'select') {
      return;
    }

    if (props != null && props.value === null && !didWarnValueNull) {
      didWarnValueNull = true;
      if (type === 'select' && props.multiple) {
        console.error(
          '`value` prop on `%s` should not be null. ' +
            'Consider using an empty array when `multiple` is set to `true` ' +
            'to clear the component or `undefined` for uncontrolled components.',
          type,
        );
      } else {
        console.error(
          '`value` prop on `%s` should not be null. ' +
            'Consider using an empty string to clear the component or `undefined` ' +
            'for uncontrolled components.',
          type,
        );
      }
    }
  }
}

Domain

Subdomains

Frequently Asked Questions

What does validateProperties() do?
validateProperties() is a function in the react codebase, defined in packages/react-dom-bindings/src/shared/ReactDOMNullInputValuePropHook.js.
Where is validateProperties() defined?
validateProperties() is defined in packages/react-dom-bindings/src/shared/ReactDOMNullInputValuePropHook.js at line 10.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free