diff --git a/src/Overlay.tsx b/src/Overlay.tsx index 747b6815398..d43018f34c0 100644 --- a/src/Overlay.tsx +++ b/src/Overlay.tsx @@ -2,7 +2,7 @@ import styled from 'styled-components' import React, {ReactElement, useEffect, useRef} from 'react' import {get, COMMON, SystemPositionProps, SystemCommonProps} from './constants' import {ComponentProps} from './utils/types' -import { useIsomorphicEffect } from './utils/useIsoMorphicEffect' +import {useIsomorphicEffect} from './utils/useIsomorphicEffect' import {useOverlay, TouchOrMouseEvent} from './hooks' import Portal from './Portal' import sx, {SxProp} from './sx' diff --git a/src/Portal/Portal.tsx b/src/Portal/Portal.tsx index 7d9f359620c..f1b6006bfc7 100644 --- a/src/Portal/Portal.tsx +++ b/src/Portal/Portal.tsx @@ -2,7 +2,6 @@ import React from 'react' import {createPortal} from 'react-dom' import {useIsomorphicEffect} from '../utils/useIsomorphicEffect' - const PRIMER_PORTAL_ROOT_ID = '__primerPortalRoot__' const DEFAULT_PORTAL_CONTAINER_NAME = '__default__' @@ -91,7 +90,6 @@ export const Portal: React.FC = ({children, onMount, containerName: return () => { parentElement.removeChild(element) } - // eslint-disable-next-line react-hooks/exhaustive-deps }, [elementRef]) return createPortal(children, elementRef.current) diff --git a/src/hooks/useCombinedRefs.ts b/src/hooks/useCombinedRefs.ts index ee03a8f5ec1..fb9e93ce9ae 100644 --- a/src/hooks/useCombinedRefs.ts +++ b/src/hooks/useCombinedRefs.ts @@ -1,4 +1,4 @@ -import {ForwardedRef, useRef} from 'react' +import {ForwardedRef, useRef} from 'react' import {useIsomorphicEffect} from '../utils/useIsomorphicEffect' /** @@ -30,11 +30,8 @@ export function useCombinedRefs(...refs: (ForwardedRef | null | undefined) return () => { // ensure the refs get updated on unmount - // eslint-disable-next-line react-hooks/exhaustive-deps setRefs(combinedRef.current) } - - // eslint-disable-next-line react-hooks/exhaustive-deps }, [...refs, combinedRef.current]) return combinedRef diff --git a/src/hooks/useResizeObserver.ts b/src/hooks/useResizeObserver.ts index 6a3c626cfd4..0ef4edb851d 100644 --- a/src/hooks/useResizeObserver.ts +++ b/src/hooks/useResizeObserver.ts @@ -1,7 +1,5 @@ -import React from 'react' import {useIsomorphicEffect} from '../utils/useIsomorphicEffect' - export function useResizeObserver(callback: () => void) { useIsomorphicEffect(() => { const observer = new window.ResizeObserver(() => callback()) diff --git a/src/utils/useIsoMorphicEffect.js b/src/utils/useIsoMorphicEffect.js index 8c101ba7548..ae3c162d9cf 100644 --- a/src/utils/useIsoMorphicEffect.js +++ b/src/utils/useIsoMorphicEffect.js @@ -1,5 +1,5 @@ -import { useEffect, useLayoutEffect } from 'react' +import {useEffect, useLayoutEffect} from 'react' export const useIsomorphicEffect = () => { return typeof window !== 'undefined' ? useLayoutEffect : useEffect -} \ No newline at end of file +}