Skip to content

Commit

Permalink
Fix: 미사용 import 삭제 및 dependency list 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
seoyoung-min authored Feb 2, 2024
1 parent 6794a9c commit fa6c2ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hooks/useOnClickOutside.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect, useRef, useState } from 'react';
import { useEffect, useRef } from 'react';

const useOnClickOutside = (handler: () => void) => {
const ref = useRef<HTMLDivElement>(null);
Expand All @@ -15,7 +15,7 @@ const useOnClickOutside = (handler: () => void) => {
document.removeEventListener('mousedown', handleClickOutside);
document.removeEventListener('touchstart', handleClickOutside);
};
}, [ref]);
}, [ref, handler]);

return { ref };
};
Expand Down

0 comments on commit fa6c2ce

Please sign in to comment.