Home / Function/ insertSubviewAtIndex() — react Function Reference

insertSubviewAtIndex() — react Function Reference

Architecture documentation for the insertSubviewAtIndex() function in UIManager.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  ab5f0882_818c_a2bc_c5b6_01af09d359db["insertSubviewAtIndex()"]
  9c099f0a_7297_4f00_cbc2_bd7d53f470db["UIManager.js"]
  ab5f0882_818c_a2bc_c5b6_01af09d359db -->|defined in| 9c099f0a_7297_4f00_cbc2_bd7d53f470db
  style ab5f0882_818c_a2bc_c5b6_01af09d359db fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-native-renderer/src/__mocks__/react-native/Libraries/ReactPrivate/UIManager.js lines 29–49

function insertSubviewAtIndex(parent, child, index) {
  const parentInfo = views.get(parent);
  const childInfo = views.get(child);

  if (childInfo.parent !== null) {
    throw new Error(
      `Inserting view ${child} ${JSON.stringify(
        childInfo.props,
      )} which already has parent`,
    );
  }

  if (0 > index || index > parentInfo.children.length) {
    throw new Error(
      `Invalid index ${index} for children ${parentInfo.children}`,
    );
  }

  parentInfo.children.splice(index, 0, child);
  childInfo.parent = parent;
}

Domain

Subdomains

Frequently Asked Questions

What does insertSubviewAtIndex() do?
insertSubviewAtIndex() is a function in the react codebase, defined in packages/react-native-renderer/src/__mocks__/react-native/Libraries/ReactPrivate/UIManager.js.
Where is insertSubviewAtIndex() defined?
insertSubviewAtIndex() is defined in packages/react-native-renderer/src/__mocks__/react-native/Libraries/ReactPrivate/UIManager.js at line 29.

Analyze Your Own Codebase

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

Try Supermodel Free