[ENG-1685] Fix 'ExplorerContext.Provider not found!' (#2210)

fix context
This commit is contained in:
nikec
2024-03-14 13:07:58 +01:00
committed by GitHub
parent 4db59b41ad
commit 4e9540e819

View File

@@ -4,7 +4,7 @@ import { useCallbackToWatchResize } from '~/hooks';
import { useExplorerContext } from '../Context';
export function useSize(ref: RefObject<Element>) {
const explorerSettings = useExplorerContext().useSettingsSnapshot();
const explorerSettings = useExplorerContext({ suspense: false })?.useSettingsSnapshot();
const initialized = useRef(false);
@@ -12,7 +12,7 @@ export function useSize(ref: RefObject<Element>) {
useEffect(() => {
initialized.current = false;
}, [explorerSettings.gridItemSize]);
}, [explorerSettings?.gridItemSize]);
useCallbackToWatchResize(
({ width, height }) => {