-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ListView] Prevent rendering during an interaction? #4359
Comments
Hey aleclarson, thanks for reporting this issue! React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.
|
I implemented this but not sure if it's something that will go into core: #2990 |
Fantastic. Thanks, @brentvatne. Any reason(s) for this not making it into core? It seems to be the only solution for avoiding |
@aleclarson - Well perhaps it could make it actually.. I've been working on something else recently to throttle paging in new rows with |
Also, @sahrens is doing a lot of work on ListView :) |
Exciting times! Janky |
I think using interaction manager is something we want to do, although it's not usually a problem because people don't often navigate before the ListView finishes rendering. You may want to adjust your initial size and other variables to mitigate. requestIdleCallback could be cool too. |
What about long lists? Paging in new rows while the user is scrolling can result in jankiness depending on the complexity of the row view; even if Also, this case could benefit from
On a side note, it could be useful to have a
How does |
Is there a small but powerful prop we could add to ListView's API to configure the incremental rendering behavior? For example, some people might want to use InteractionManager, some people want to use requestIdleCallback, and others might want to use other heuristics such as capping the number of rows per frame ( Here's a first take at an API: <ListView
shouldRenderRow={(rowData, sectionId, rowId, <what else?>) => boolean}
/> For convenience we may want to also pass in the number of rows rendered during this pass of the JS event loop -- implementing shouldRenderRow={(rowData, sectionId, rowId, numberOfMarginalRowsRendered) =>
numberOfMarginalRowsRendered < pageSize
} The main things I like about this approach is that ListView doesn't become more of a monster API and it pushes the complexity out of the component and into userspace. |
Another option would be to inject a task queue into ListView, which could On Monday, December 7, 2015, James Ide notifications@github.com wrote:
|
it does not solve all the problems listed here but for navigation fluidity related problems, you can check https://github.com/machard/react-native-advanced-navigation |
Hi there! This issue is being closed because it has been inactive for a while. But don't worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/listview-prevent-rendering-during-an-interaction ProductPains helps the community prioritize the most important issues thanks to its voting feature. Also, if this issue is a bug, please consider sending a pull request with a fix. |
I noticed that extreme jitter occurs if a
ListView
renders rows during a pan interaction. Is there any way to stop theListView
from rendering rows (maybe usingInteractionManager
)? Thanks!The text was updated successfully, but these errors were encountered: