I need two lists to scroll together (a.g. scrolling one will scroll the other as well and vice versa). But using
<FirstList onScroll={({scrollOffset})=> secondListRef.scrollTo(scrollOffset)} .../>
and
<SecondList onScroll={({scrollOffset})=>firstListRef.scrollTo(scrollOffset)} .../>
creates infinite scroll updates and the app crashes by reaching maximum rerender depth.
Could you include a way to access the current offset of component so that it can be used to block further calling of scrollTo (when both offsets are the same). Of course I can store the offsets in state variables but that is too slow and causes laggy scrolling, only viable scrolling is by using refrences.
Or do you have any thoughts how to implement this behaviour?
P.S.: In reality I want VariableSizeGrid as a table with variable widths of columns but fixed heights of rows and FixedSizeList as first column (headers of rows) to scroll together in Y direction, but I simplyfied it in the example above);
I need two lists to scroll together (a.g. scrolling one will scroll the other as well and vice versa). But using
<FirstList onScroll={({scrollOffset})=> secondListRef.scrollTo(scrollOffset)} .../>
and
<SecondList onScroll={({scrollOffset})=>firstListRef.scrollTo(scrollOffset)} .../>
creates infinite scroll updates and the app crashes by reaching maximum rerender depth.
Could you include a way to access the current offset of component so that it can be used to block further calling of scrollTo (when both offsets are the same). Of course I can store the offsets in state variables but that is too slow and causes laggy scrolling, only viable scrolling is by using refrences.
Or do you have any thoughts how to implement this behaviour?
P.S.: In reality I want VariableSizeGrid as a table with variable widths of columns but fixed heights of rows and FixedSizeList as first column (headers of rows) to scroll together in Y direction, but I simplyfied it in the example above);