Skip to content

Commit

Permalink
[233] Add null type fallback to targetRef
Browse files Browse the repository at this point in the history
  • Loading branch information
snelsi committed Feb 17, 2023
1 parent 6b2d8e8 commit 7226b89
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 7226b89

Please sign in to comment.