From 97ba4fb16aa81978bd29fc090d1dcf33a7b5189e Mon Sep 17 00:00:00 2001 From: Oleksandr Fediashov Date: Mon, 8 Jan 2024 15:14:38 +0100 Subject: [PATCH] fix(react-shadow): remove sync logic --- ...-50d448d8-13a6-4c02-b2a2-4054e6111b5f.json | 7 +++++ packages/react-shadow/src/root.tsx | 26 ------------------- 2 files changed, 7 insertions(+), 26 deletions(-) create mode 100644 change/@fluentui-contrib-react-shadow-50d448d8-13a6-4c02-b2a2-4054e6111b5f.json diff --git a/change/@fluentui-contrib-react-shadow-50d448d8-13a6-4c02-b2a2-4054e6111b5f.json b/change/@fluentui-contrib-react-shadow-50d448d8-13a6-4c02-b2a2-4054e6111b5f.json new file mode 100644 index 00000000..dbfe7210 --- /dev/null +++ b/change/@fluentui-contrib-react-shadow-50d448d8-13a6-4c02-b2a2-4054e6111b5f.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "fix: remove sync logic", + "packageName": "@fluentui-contrib/react-shadow", + "email": "olfedias@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/packages/react-shadow/src/root.tsx b/packages/react-shadow/src/root.tsx index 83321e8d..09396af4 100644 --- a/packages/react-shadow/src/root.tsx +++ b/packages/react-shadow/src/root.tsx @@ -13,32 +13,6 @@ const ReactComponentsWrapper: React.FC<{ }> = ({ children, root }) => { const renderer = React.useMemo(() => createShadowDOMRenderer(root), [root]); - // TODO: explain this - React.useLayoutEffect(() => { - if (renderer.adoptedStyleSheets && renderer.adoptedStyleSheets.length > 0) { - if ( - root.adoptedStyleSheets.find( - (styleSheet) => styleSheet === renderer.adoptedStyleSheets[0] - ) - ) { - return; - } - - root.adoptedStyleSheets = [ - ...root.adoptedStyleSheets, - ...renderer.adoptedStyleSheets, - ]; - } - }, [renderer.adoptedStyleSheets, root.adoptedStyleSheets]); - - // TODO: polyfill does not work with ShadowRoot - // React.useLayoutEffect(() => { - // applyFocusVisiblePolyfill( - // root.host as HTMLElement, - // root.ownerDocument.defaultView! - // ); - // }, [root]); - return ( {children}