diff --git a/code/renderers/react/src/renderToCanvas.tsx b/code/renderers/react/src/renderToCanvas.tsx index 2b40f3f47dd2..57c1086cee1b 100644 --- a/code/renderers/react/src/renderToCanvas.tsx +++ b/code/renderers/react/src/renderToCanvas.tsx @@ -112,8 +112,8 @@ export async function renderToCanvas( processActQueue(); }); - return () => { - act(() => { + return async () => { + await act(() => { unmountElement(canvasElement); }); };