import { ScrollArea, List } from '@mantine/core';
import { Message } from '../Message';
import * as React from 'react';
export const MessagesList = () => {
const viewport = React.useRef<HTMLDivElement | null>(null);
React.useEffect(() => {
if (viewport.current) {
viewport.current.scrollTo({ top: viewport.current.scrollHeight });
}
}, [viewport.current]);
return (
<ScrollArea
viewportRef={viewport}
styles={{
root: {
height: '100%',
},
viewport: { flexGrow: 1, '& > div': { height: '100%' } },
}}
>
<List listStyleType="none" pl="md" pt="md">
<Message username="LouieMartin" text="Hello, world!" />
</List>
</ScrollArea>
);
};
#Why is ScrollArea not working when testing with Vitest?
6 messages · Page 1 of 1 (latest)
Reproduce in a codesandbox please Duh, this is a testing question...
i always found testing useRef stuff in Reacting Testing Library + Jest pretty annoying
Ok
Imma just reproduce with GitHub