Last active
October 15, 2021 15:59
-
-
Save biancadragomir/246b204494f3f127c3090f0175c594fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
type Props = { | |
const isPopupOpen: boolean; | |
const closePopup: () => void; | |
} | |
const Popup = (props: Props) => { | |
... | |
const handleScroll = useCallback(() => { | |
if (props.isPopupOpen) { | |
props.closePopup(); | |
} | |
}, [props.isPopupOpen]); | |
useOnScrollEffect(handleScroll, INFINITE_SCROLL_ID); | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment