bvaughn / react-virtualized-auto-sizer

Standalone version of the AutoSizer component from react-virtualized

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bailoutOnChildren causes remounts

chrisnojima opened this issue · comments

Hey,

I'm building an app that uses react navigation which includes a tab navigation. When a tab isn't selected I'm hiding the parent screens using display: none so I can retain scrolling positions as users tab around the app. I noticed that one of my lists was losing its scroll and entirely being remounted and it's due to the usage of the ResizeObserver calling the onResize callback while the screen is in this state. Previously it'd just render but now since bailoutOnChildren is true (due to the rect being 0x0) it'll render no children, then when you tab back it'll render again. It might be nice to have a flag to control if this bail out happens

Thanks!

Hmm... that makes sense. Let me think about it a bit.

There's a new prop in react-virtualized-auto-sizer@1.0.24 called doNotBailOutOnEmptyChildren that will do what you want


❤️ → ☕ givebrian.coffee

Thanks a bunch!