Created
February 3, 2020 22:55
-
-
Save blikblum/8aa046befce563df5de7bd69bd739197 to your computer and use it in GitHub Desktop.
Markdium-From React to Web Components: using hooks
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 messagesRef = useRef(); | |
useEffect(() => { | |
if (messagesRef.current) { | |
messagesRef.current.scrollTop = messagesRef.current.scrollHeight; | |
} | |
}, [messages]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment