React Testing Library · Function
waitForElementToBeRemoved
waitForElementToBeRemoved waits for an existing element or elements to leave the DOM. It accepts a node, an array, or a callback that finds them, and returns a Promise.
Last updated
Syntax
function waitForElementToBeRemoved<T>(callback: (() => T) | T, options?: { container?: HTMLElement; timeout?: number; interval?: number; onTimeout?: (error: Error) => Error; mutationObserverOptions?: MutationObserverInit }): Promise<void>In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
waitForfindBy queriesqueryBy queriesqueryAllBy queries