Skip to content

Instantly share code, notes, and snippets.

@blikblum
Created February 3, 2020 22:55
Show Gist options
  • Save blikblum/8aa046befce563df5de7bd69bd739197 to your computer and use it in GitHub Desktop.
Save blikblum/8aa046befce563df5de7bd69bd739197 to your computer and use it in GitHub Desktop.
Markdium-From React to Web Components: using hooks
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