Home / Function/ validateTextareaProps() — react Function Reference

validateTextareaProps() — react Function Reference

Architecture documentation for the validateTextareaProps() function in ReactDOMTextarea.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  aa47db66_cd94_e0b4_994c_53a44e314f53["validateTextareaProps()"]
  446613e2_b928_8e56_f59b_835fe6aa10b1["ReactDOMTextarea.js"]
  aa47db66_cd94_e0b4_994c_53a44e314f53 -->|defined in| 446613e2_b928_8e56_f59b_835fe6aa10b1
  67179d73_9067_5546_577d_fb4a19901587["setInitialProperties()"]
  67179d73_9067_5546_577d_fb4a19901587 -->|calls| aa47db66_cd94_e0b4_994c_53a44e314f53
  becc720a_d6e4_9801_f3ba_53c3713502e2["hydrateProperties()"]
  becc720a_d6e4_9801_f3ba_53c3713502e2 -->|calls| aa47db66_cd94_e0b4_994c_53a44e314f53
  style aa47db66_cd94_e0b4_994c_53a44e314f53 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-dom-bindings/src/client/ReactDOMTextarea.js lines 37–62

export function validateTextareaProps(element: Element, props: Object) {
  if (__DEV__) {
    if (
      props.value !== undefined &&
      props.defaultValue !== undefined &&
      !didWarnValDefaultVal
    ) {
      console.error(
        '%s contains a textarea with both value and defaultValue props. ' +
          'Textarea 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 textarea ' +
          'and remove one of these props. More info: ' +
          'https://react.dev/link/controlled-components',
        getCurrentFiberOwnerNameInDevOrNull() || 'A component',
      );
      didWarnValDefaultVal = true;
    }
    if (props.children != null && props.value == null) {
      console.error(
        'Use the `defaultValue` or `value` props instead of setting ' +
          'children on <textarea>.',
      );
    }
  }
}

Domain

Subdomains

Frequently Asked Questions

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