Skip to content

Commit

Permalink
Merge pull request #234 from snelsi/bug/233-target-ref-null
Browse files Browse the repository at this point in the history
[233] Add null type fallback to targetRef
  • Loading branch information
maslianok committed Feb 18, 2023
2 parents 6b2d8e8 + 7226b89 commit 62c2a72
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/useResizeDetector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type { Props, ReactResizeDetectorDimensions } from './ResizeDetector';
const useEnhancedEffect = isSSR() ? useEffect : useLayoutEffect;

export interface useResizeDetectorProps<T extends HTMLElement> extends Props {
targetRef?: MutableRefObject<T>;
targetRef?: MutableRefObject<T | null>;
}

function useResizeDetector<T extends HTMLElement = any>(props: useResizeDetectorProps<T> = {}): UseResizeDetectorReturn<T> {
Expand Down

0 comments on commit 62c2a72

Please sign in to comment.