Skip to content
masterclass Buddy

React Testing Library · Function

waitFor

Use findBy... to wait for one element to appear. Use waitFor for a condition that must become true, and waitForElementToBeRemoved when existing elements should disappear.

Last updated

Syntax

findBy...(query, queryOptions?, waitForOptions?)
waitFor(callback, options?)
waitForElementToBeRemoved(callbackOrElement, options?)

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

Subscribe
  • getBy...
  • queryBy...
  • findAllBy...
  • waitFor
  • waitForElementToBeRemoved
  • MutationObserver

Source: Async Methods | Testing Library. Checked 2026-11-03.