petyosi / react-virtuoso

The most powerful virtual list component for React
https://virtuoso.dev
MIT License
5.16k stars 299 forks source link

ResizeObserver loop completed with undelivered notifications appears in the Virtuoso component #987

Closed daizhun closed 11 months ago

daizhun commented 11 months ago

<Virtuoso data={dialogs} itemContent={(index, item) => {

                if (item._type && item._type === 'groupTitle') {
                    return (
                        <Box pl={3} pt={3} pb={1}><Text color="gray.500">{item.title}</Text></Box>
                    )
                }
               return (
                    <Box paddingBottom={1} paddingLeft={1.5} paddingRight={1.5}>121231</Box>
               )
        />

In the above code, the height of each rendered element must be greater than 43px, and adaptive height cannot be achieved. An error ResizeObserver loop completed with undelivered notifications will appear, I tried to find alternative methods in the official documents, but I didn't find out if there is a great god who has a way to solve this problem

petyosi commented 11 months ago

Follow the template and reproduce the problem in a sandbox.