Skip to content
masterclass Buddy

React Testing Library · Matcher

toContainElement

render mounts a React element for a test and returns queries plus helpers for inspecting, updating, and removing the rendered output. It is the main entry point for testing React components with React Testing Library.

Last updated

Syntax

function render(ui: React.ReactElement<any>, options?: { /* render options */ }): RenderResult

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • render
  • RenderResult
  • cleanup
  • act
  • renderHook
  • configure
  • within
  • getBy

Source: API | Testing Library. Checked 2026-11-03.