question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[ReactNative] this.virtualRenderer not always initialized in RecyclerListView

See original GitHub issue

First of all, thanks a lot for creating this great list view component. The built in FlatList and SectionList components of react-native are pretty bad at handling initial scrollOffsets, where this component really shines (especially with ContextProvider).

I found a bug where new props lead to exceptions through the componentWillReceiveProps call in RecyclerListView:

When the RecyclerListViews parent is re-rendered early after being mounted, the RecyclerListView’s componentWillReceiveProps is called, but this.virtualizedRenderer is not yet initialized. This will lead to two exceptions in the following lines:

As a quick fix, I wrapped both lines in an if (this.virtualRenderer) { ... } and there are no more exceptions or weird behavior.

You can try out the following sample to reproduce the bug:

Sample Repo

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:16

github_iconTop GitHub Comments

1reaction
AbdallaElabdcommented, Sep 21, 2017

Even if I rendered the RecyclerListView after I load the data. I’d still have to imperatively scroll to the desired index, which will break because of #44. Thanks for the suggestion though.

0reactions
naqvitalhacommented, Sep 28, 2017

cross-platform@flipkart.com is public now… it should be working… can you try now? If it doesn’t please DM me on twitter… I’ll pass on the email there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

RecyclerListView Warning in React Native App - Stack Overflow
Does anyone know why this warning is coming? You have mounted RecyclerListView with an empty data provider (Size in 0). Please mount only...
Read more >
RecyclerListView vs. FlatList for long lists in React Native
RecyclerListView is a better option than the FlatList component if your use case involves rendering a long list of items, probably several views ......
Read more >
RecyclerListView In React Native Hooks - YouTube
Yo! in today's video we'll learn how to work with the recyclerlistview in react native I hope you enjoy the video docs: ...
Read more >
Getting started | React Native Performance - Shopify
The Performance profiler library needs to be initialized in all 3 parts of your app: Android Native, iOS Native, and TS. Android Native...
Read more >
RecyclerListView: High performance ListView for React Native ...
Also, we have cross platform goals and these listviews had no way to really work on the web. So, to get around all...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found