Home / Function/ checkControlledValueProps() — react Function Reference

checkControlledValueProps() — react Function Reference

Architecture documentation for the checkControlledValueProps() function in ReactControlledValuePropTypes.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  25aca4ae_e70f_705d_7673_e44af72ab539["checkControlledValueProps()"]
  610351e4_d33b_fa99_6ef7_a03d24afd5a4["ReactControlledValuePropTypes.js"]
  25aca4ae_e70f_705d_7673_e44af72ab539 -->|defined in| 610351e4_d33b_fa99_6ef7_a03d24afd5a4
  96cf114b_9b89_b174_432c_1584a973fcdd["setInitialProperties()"]
  96cf114b_9b89_b174_432c_1584a973fcdd -->|calls| 25aca4ae_e70f_705d_7673_e44af72ab539
  894d4888_e1c9_cdd6_e0cb_7451b6fba151["hydrateProperties()"]
  894d4888_e1c9_cdd6_e0cb_7451b6fba151 -->|calls| 25aca4ae_e70f_705d_7673_e44af72ab539
  style 25aca4ae_e70f_705d_7673_e44af72ab539 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-dom-bindings/src/shared/ReactControlledValuePropTypes.js lines 20–66

export function checkControlledValueProps(
  tagName: string,
  props: Object,
): void {
  if (__DEV__) {
    if (
      !(
        hasReadOnlyValue[props.type] ||
        props.onChange ||
        props.onInput ||
        props.readOnly ||
        props.disabled ||
        props.value == null
      )
    ) {
      if (tagName === 'select') {
        console.error(
          'You provided a `value` prop to a form field without an ' +
            '`onChange` handler. This will render a read-only field. If ' +
            'the field should be mutable use `defaultValue`. Otherwise, set `onChange`.',
        );
      } else {
        console.error(
          'You provided a `value` prop to a form field without an ' +
            '`onChange` handler. This will render a read-only field. If ' +
            'the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.',
        );
      }
    }

    if (
      !(
        props.onChange ||
        props.readOnly ||
        props.disabled ||
        props.checked == null
      )
    ) {
      console.error(
        'You provided a `checked` prop to a form field without an ' +
          '`onChange` handler. This will render a read-only field. If ' +
          'the field should be mutable use `defaultChecked`. Otherwise, ' +
          'set either `onChange` or `readOnly`.',
      );
    }
  }
}

Domain

Subdomains

Frequently Asked Questions

What does checkControlledValueProps() do?
checkControlledValueProps() is a function in the react codebase, defined in packages/react-dom-bindings/src/shared/ReactControlledValuePropTypes.js.
Where is checkControlledValueProps() defined?
checkControlledValueProps() is defined in packages/react-dom-bindings/src/shared/ReactControlledValuePropTypes.js at line 20.
What calls checkControlledValueProps()?
checkControlledValueProps() 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