Home / Function/ hasValidRef() — react Function Reference

hasValidRef() — react Function Reference

Architecture documentation for the hasValidRef() function in ReactJSXElement.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  586a9a31_9293_5e79_1a20_3d378d66778a["hasValidRef()"]
  1bf5591f_27a1_c79f_853a_6242549e0e07["ReactJSXElement.js"]
  586a9a31_9293_5e79_1a20_3d378d66778a -->|defined in| 1bf5591f_27a1_c79f_853a_6242549e0e07
  e25f8b64_9c1b_41a7_d00a_3663a86ab332["cloneElement()"]
  e25f8b64_9c1b_41a7_d00a_3663a86ab332 -->|calls| 586a9a31_9293_5e79_1a20_3d378d66778a
  style 586a9a31_9293_5e79_1a20_3d378d66778a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react/src/jsx/ReactJSXElement.js lines 97–107

function hasValidRef(config) {
  if (__DEV__) {
    if (hasOwnProperty.call(config, 'ref')) {
      const getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
      if (getter && getter.isReactWarning) {
        return false;
      }
    }
  }
  return config.ref !== undefined;
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does hasValidRef() do?
hasValidRef() is a function in the react codebase, defined in packages/react/src/jsx/ReactJSXElement.js.
Where is hasValidRef() defined?
hasValidRef() is defined in packages/react/src/jsx/ReactJSXElement.js at line 97.
What calls hasValidRef()?
hasValidRef() is called by 1 function(s): cloneElement.

Analyze Your Own Codebase

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

Try Supermodel Free