Home / Function/ addItem() — react Function Reference

addItem() — react Function Reference

Architecture documentation for the addItem() function in list-app-utils.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  ed179180_8d7e_50e6_ab1f_fd57d72b908c["addItem()"]
  9549e4be_b4c1_b9fc_73c8_05b6ffbbe985["list-app-utils.js"]
  ed179180_8d7e_50e6_ab1f_fd57d72b908c -->|defined in| 9549e4be_b4c1_b9fc_73c8_05b6ffbbe985
  style ed179180_8d7e_50e6_ab1f_fd57d72b908c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/react-devtools-inline/__tests__/__e2e__/list-app-utils.js lines 5–21

async function addItem(page, newItemText) {
  await page.evaluate(text => {
    const {createTestNameSelector, findAllNodes} = window.REACT_DOM_APP;
    const container = document.getElementById('iframe').contentDocument;

    const input = findAllNodes(container, [
      createTestNameSelector('AddItemInput'),
    ])[0];
    input.value = text;

    const button = findAllNodes(container, [
      createTestNameSelector('AddItemButton'),
    ])[0];

    button.click();
  }, newItemText);
}

Domain

Subdomains

Frequently Asked Questions

What does addItem() do?
addItem() is a function in the react codebase, defined in packages/react-devtools-inline/__tests__/__e2e__/list-app-utils.js.
Where is addItem() defined?
addItem() is defined in packages/react-devtools-inline/__tests__/__e2e__/list-app-utils.js at line 5.

Analyze Your Own Codebase

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

Try Supermodel Free