Skip to content

Commit

Permalink
fix(unmount): Flush cleanup functions syncronously
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Jul 15, 2020
1 parent 6ef64ea commit 3865525
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pure.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ function render(
el.forEach(e => console.log(prettyDOM(e, maxLength, options)))
: // eslint-disable-next-line no-console,
console.log(prettyDOM(el, maxLength, options)),
unmount: () => ReactDOM.unmountComponentAtNode(container),
unmount: () => {
act(() => {
ReactDOM.unmountComponentAtNode(container)
})
},
rerender: rerenderUi => {
render(wrapUiIfNeeded(rerenderUi), {container, baseElement})
// Intentionally do not return anything to avoid unnecessarily complicating the API.
Expand Down

0 comments on commit 3865525

Please sign in to comment.