I'm using react-window to render a long list to show messages. but how can I move scroll to bottom for each new messages?
I could handle it for normal Div by using useRef, but what about react-window?
const list = useRef<HTMLDivElement>(document.createElement('div'));
useEffect(() => {
list.current.scrollTop = list.current.scrollHeight;
}, [message]);
and:
<FixedSizeList
width="100%"
height={500}
itemCount={messages.length}
itemSize={40}
itemData={messages}
>
{Row}
</FixedSizeList>