Created
November 24, 2021 18:20
-
-
Save alx8437/61ed49aeb474b4b5695505601618f063 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
const [containerHeight, setContainerHeight] = useState<number>(0); | |
const containerHeightRef = useCallback((node) => { | |
if (node !== null) { | |
setContainerHeight(node.getBoundingClientRect().height); | |
} | |
}, []); | |
<div ref={containerHeightRef}></div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment