{
  "doc": {
    "id": "app/component-testing/react/api",
    "title": "React API",
    "description": "API for mounting React components in Cypress tests.",
    "section": "app",
    "source_path": "/llm/markdown/app/component-testing/react/api.md",
    "version": "e6988a974973e9090ce70406c38cb2b9e0eac9fa",
    "updated_at": "2026-05-15T15:50:22.536Z",
    "headings": [
      {
        "id": "app/component-testing/react/api#react-api",
        "text": "React API",
        "level": 1
      },
      {
        "id": "app/component-testing/react/api#methods",
        "text": "Methods",
        "level": 2
      },
      {
        "id": "app/component-testing/react/api#mount",
        "text": "mount",
        "level": 3
      },
      {
        "id": "app/component-testing/react/api#example",
        "text": "Example",
        "level": 4
      },
      {
        "id": "app/component-testing/react/api#getcontainerel",
        "text": "getContainerEl",
        "level": 3
      },
      {
        "id": "app/component-testing/react/api#interfaces",
        "text": "Interfaces",
        "level": 2
      },
      {
        "id": "app/component-testing/react/api#mountoptions",
        "text": "MountOptions",
        "level": 3
      },
      {
        "id": "app/component-testing/react/api#mountreturn",
        "text": "MountReturn",
        "level": 3
      }
    ]
  },
  "chunks": [
    {
      "id": "app/component-testing/react/api#methods",
      "doc_id": "app/component-testing/react/api",
      "heading": "Methods",
      "heading_level": 2,
      "content_markdown": "## Methods\n\n### mount\n\n```\nimport { mount } from 'cypress/react'\n```\n\n<table><tbody><tr><td>Description</td><td>Mounts a React component into the DOM.</td></tr><tr><td>Signature</td><td><p>mount(jsx: React.ReactNode, options?: MountOptions, rerenderKey?: string): Cypress.Chainable&lt;MountReturn&gt;</p></td></tr><tr><td>Returns</td><td>Cypress.Chainable&lt;MountReturn&gt;</td></tr></tbody></table>\n\n<table><caption>mount Parameters</caption><thead></thead><tbody><tr><td>Name</td><td>Type</td><td>Description</td></tr><tr><td>jsx</td><td>React.JSX.Element</td><td>The React component to mount.</td></tr><tr><td>options</td><td>MountOptions (optional)</td><td>The options for mounting the component</td></tr><tr><td>rerenderKey</td><td>string (optional)</td><td>A key to use to force a rerender.</td></tr></tbody></table>\n\n#### Example\n\n```\nimport { mount } from '@cypress/react'import { Stepper } from './Stepper'it('mounts', () => {  mount(<StepperComponent />)  cy.get('[data-cy=increment]').click()  cy.get('[data-cy=counter]').should('have.text', '1')}\n```\n\n### getContainerEl\n\n<table><tbody><tr><td>Description</td><td>Gets the root element used to mount the component.</td></tr><tr><td>Signature</td><td>() =&gt; HTMLElement</td></tr><tr><td>Returns</td><td>HTMLElement</td></tr></tbody></table>\n",
      "section": "app",
      "anchors": [
        "methods"
      ],
      "path": "/llm/json/chunked/app/component-testing/react/api.json",
      "token_estimate": 108
    },
    {
      "id": "app/component-testing/react/api#mount",
      "doc_id": "app/component-testing/react/api",
      "heading": "mount",
      "heading_level": 3,
      "content_markdown": "### mount\n\n```\nimport { mount } from 'cypress/react'\n```\n\n<table><tbody><tr><td>Description</td><td>Mounts a React component into the DOM.</td></tr><tr><td>Signature</td><td><p>mount(jsx: React.ReactNode, options?: MountOptions, rerenderKey?: string): Cypress.Chainable&lt;MountReturn&gt;</p></td></tr><tr><td>Returns</td><td>Cypress.Chainable&lt;MountReturn&gt;</td></tr></tbody></table>\n\n<table><caption>mount Parameters</caption><thead></thead><tbody><tr><td>Name</td><td>Type</td><td>Description</td></tr><tr><td>jsx</td><td>React.JSX.Element</td><td>The React component to mount.</td></tr><tr><td>options</td><td>MountOptions (optional)</td><td>The options for mounting the component</td></tr><tr><td>rerenderKey</td><td>string (optional)</td><td>A key to use to force a rerender.</td></tr></tbody></table>\n\n#### Example\n\n```\nimport { mount } from '@cypress/react'import { Stepper } from './Stepper'it('mounts', () => {  mount(<StepperComponent />)  cy.get('[data-cy=increment]').click()  cy.get('[data-cy=counter]').should('have.text', '1')}\n```\n",
      "section": "app",
      "anchors": [
        "mount"
      ],
      "path": "/llm/json/chunked/app/component-testing/react/api.json",
      "token_estimate": 88
    },
    {
      "id": "app/component-testing/react/api#interfaces",
      "doc_id": "app/component-testing/react/api",
      "heading": "Interfaces",
      "heading_level": 2,
      "content_markdown": "## Interfaces\n\n### MountOptions\n\n<table><caption>members</caption><thead></thead><tbody><tr><td>Name</td><td>Type</td><td>Description</td></tr><tr><td>alias</td><td>string (optional)</td><td></td></tr><tr><td>ReactDom</td><td>MountReactComponentOptions.ReactDom (optional)</td><td></td></tr><tr><td>log</td><td>boolean (optional)</td><td>Log the mounting command into Cypress Command Log, true by default</td></tr><tr><td>strict</td><td>boolean (optional)</td><td><p>Render component in React <a href=\"https://reactjs.org/docs/strict-mode.html\">strict mode</a> It activates additional checks and warnings for child components.</p></td></tr></tbody></table>\n\n### MountReturn\n\nType that the `mount` function yields\n\n<table><caption>members</caption><thead></thead><tbody><tr><td>Name</td><td>Type</td><td>Description</td></tr><tr><td>component</td><td>React.ReactNode</td><td><p>Render component in React <a href=\"https://reactjs.org/docs/strict-mode.html\">strict mode</a> It activates additional checks and warnings for child components.</p></td></tr><tr><td>rerender</td><td><p>(component: React.ReactNode) =&gt; globalThis.Cypress.Chainable&lt;MountReturn&gt;</p></td><td>The component that was rendered.</td></tr></tbody></table>\n",
      "section": "app",
      "anchors": [
        "interfaces"
      ],
      "path": "/llm/json/chunked/app/component-testing/react/api.json",
      "token_estimate": 87
    },
    {
      "id": "app/component-testing/react/api#mountoptions",
      "doc_id": "app/component-testing/react/api",
      "heading": "MountOptions",
      "heading_level": 3,
      "content_markdown": "### MountOptions\n\n<table><caption>members</caption><thead></thead><tbody><tr><td>Name</td><td>Type</td><td>Description</td></tr><tr><td>alias</td><td>string (optional)</td><td></td></tr><tr><td>ReactDom</td><td>MountReactComponentOptions.ReactDom (optional)</td><td></td></tr><tr><td>log</td><td>boolean (optional)</td><td>Log the mounting command into Cypress Command Log, true by default</td></tr><tr><td>strict</td><td>boolean (optional)</td><td><p>Render component in React <a href=\"https://reactjs.org/docs/strict-mode.html\">strict mode</a> It activates additional checks and warnings for child components.</p></td></tr></tbody></table>\n",
      "section": "app",
      "anchors": [
        "mountoptions"
      ],
      "path": "/llm/json/chunked/app/component-testing/react/api.json",
      "token_estimate": 43
    },
    {
      "id": "app/component-testing/react/api#mountreturn",
      "doc_id": "app/component-testing/react/api",
      "heading": "MountReturn",
      "heading_level": 3,
      "content_markdown": "### MountReturn\n\nType that the `mount` function yields\n\n<table><caption>members</caption><thead></thead><tbody><tr><td>Name</td><td>Type</td><td>Description</td></tr><tr><td>component</td><td>React.ReactNode</td><td><p>Render component in React <a href=\"https://reactjs.org/docs/strict-mode.html\">strict mode</a> It activates additional checks and warnings for child components.</p></td></tr><tr><td>rerender</td><td><p>(component: React.ReactNode) =&gt; globalThis.Cypress.Chainable&lt;MountReturn&gt;</p></td><td>The component that was rendered.</td></tr></tbody></table>\n",
      "section": "app",
      "anchors": [
        "mountreturn"
      ],
      "path": "/llm/json/chunked/app/component-testing/react/api.json",
      "token_estimate": 41
    }
  ]
}