Update to latest eslint-plugin-react-hooks (#36702)
Co-authored-by: diondiondion <mail@diondiondion.com>
This commit is contained in:
1 parent
4ddddc2573
commit
9addad8ce5
27 files changed
+382
-320
No files matched your search
@@ -27,7 +27,6 @@ export const HoverCardController: React.FC = () => {
|
||||
const [setLeaveTimeout, cancelLeaveTimeout] = useTimeout();
|
||||
const [setEnterTimeout, cancelEnterTimeout, delayEnterTimeout] = useTimeout();
|
||||
const [setScrollTimeout] = useTimeout();
|
||||
const location = useLocation();
|
||||
|
||||
const handleClose = useCallback(() => {
|
||||
cancelEnterTimeout();
|
||||
@@ -36,9 +35,12 @@ export const HoverCardController: React.FC = () => {
|
||||
setAnchor(null);
|
||||
}, [cancelEnterTimeout, cancelLeaveTimeout, setOpen, setAnchor]);
|
||||
|
||||
useEffect(() => {
|
||||
const location = useLocation();
|
||||
const [previousLocation, setPreviousLocation] = useState(location);
|
||||
if (location !== previousLocation) {
|
||||
setPreviousLocation(location);
|
||||
handleClose();
|
||||
}, [handleClose, location]);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
let isScrolling = false;
|
||||
|
||||
Reference in new issue
Block a user