useeffect triggers react warning 'expected static flag was missing' but workarounds don't look as nice

This commit is contained in:
Daniel Avila 2023-02-07 19:07:12 -05:00
parent 6842ac880c
commit 053368646d

View file

@ -14,6 +14,8 @@ export default function Messages({ messages }) {
messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' });
};
// this useEffect triggers the following warning:
// Warning: Internal React error: Expected static flag was missing.
useEffect(() => {
scrollToBottom();
}, [messages]);