Files
react-native/Libraries
Spencer Ahrens 52e50af56d Fix and optimize VirtualizedList update triggers
Summary:
- If the initial render doesn't extend past `onEndReachedThreshold` it is likely that onEndReached won't get called until scroll, which can be a bad experience if the `initialNumToRender` is very close to the viewport height. This happens because when `onContentSizeChange`, `onLayout` may not have fired yet so we don't know what the `visibleLength` is. Fix is to also call `maybeCallOnEndReached` in `_onLayout` as well.

- We have an optimization that does hi-pri render window updates when scrolling quickly and the content reaches the edge of the viewport, but there is also an important case where the user has scrolled to the end of the content and is waiting for a network response. Once the new data comes in, we want to render it ASAP because the user is waiting for it. To solve this we refactor our scheduling code into a shared function that always checks if it should be a hi-pri update instead of just in `_onScroll`.

Reviewed By: bvaughn

Differential Revision: D4975314

fbshipit-source-id: 8d64832ecbcbdbac430a08a4018d7a32b2216a85
2017-05-03 10:34:58 -07:00
..
2017-04-28 06:34:21 -07:00
2017-04-18 14:00:18 -07:00
2017-02-21 09:11:01 -08:00
2017-04-28 04:04:14 -07:00
2017-03-28 08:38:13 -07:00
2016-11-02 12:29:15 -07:00
2017-04-05 18:31:06 -07:00
2017-04-28 04:04:14 -07:00
2017-04-26 04:00:09 -07:00
2017-01-31 11:13:50 -08:00
2017-04-26 11:31:56 -07:00
2017-02-21 15:18:40 -08:00
2017-04-26 11:31:56 -07:00
2017-03-21 08:01:58 -07:00
2017-04-17 07:30:18 -07:00