diff --git a/src/aipane/index.tsx b/src/aipane/index.tsx index 0f46ae4..78effac 100644 --- a/src/aipane/index.tsx +++ b/src/aipane/index.tsx @@ -48,6 +48,17 @@ const router = createBrowserRouter( /* Render application after Office initializes */ Office.onReady(() => { + const resizeObserver = new ResizeObserver((entries) => { + // We wrap it in requestAnimationFrame to avoid this error - ResizeObserver loop limit exceeded + window.requestAnimationFrame(() => { + if (!Array.isArray(entries) || !entries.length) { + return; + } + // your code + }); + }); + resizeObserver.observe(document.body); + root?.render(