Skip to content

Commit 3865525

Browse files
committed
fix(unmount): Flush cleanup functions syncronously
1 parent 6ef64ea commit 3865525

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/pure.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ function render(
7474
el.forEach(e => console.log(prettyDOM(e, maxLength, options)))
7575
: // eslint-disable-next-line no-console,
7676
console.log(prettyDOM(el, maxLength, options)),
77-
unmount: () => ReactDOM.unmountComponentAtNode(container),
77+
unmount: () => {
78+
act(() => {
79+
ReactDOM.unmountComponentAtNode(container)
80+
})
81+
},
7882
rerender: rerenderUi => {
7983
render(wrapUiIfNeeded(rerenderUi), {container, baseElement})
8084
// Intentionally do not return anything to avoid unnecessarily complicating the API.

0 commit comments

Comments
 (0)