MCPcopy
hub / github.com/testing-library/react-testing-library / cleanup

Function cleanup

src/pure.js:307–318  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

305}
306
307function cleanup() {
308 mountedRootEntries.forEach(({root, container}) => {
309 act(() => {
310 root.unmount()
311 })
312 if (container.parentNode === document.body) {
313 document.body.removeChild(container)
314 }
315 })
316 mountedRootEntries.length = 0
317 mountedContainers.clear()
318}
319
320function renderHook(renderCallback, options = {}) {
321 const {initialProps, ...renderOptions} = options

Callers 2

index.jsFile · 0.90
cleanup.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…