{"action":"created","issue":{"url":"https://api.github.com/repos/Flipkart/ReactEssentials/issues/40","repository_url":"https://api.github.com/repos/Flipkart/ReactEssentials","labels_url":"https://api.github.com/repos/Flipkart/ReactEssentials/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/Flipkart/ReactEssentials/issues/40/comments","events_url":"https://api.github.com/repos/Flipkart/ReactEssentials/issues/40/events","html_url":"https://github.com/Flipkart/ReactEssentials/issues/40","id":255987298,"number":40,"title":"[ReactNative] this.virtualRenderer not always initialized in RecyclerListView","user":{"login":"peterjuras","id":3640638,"avatar_url":"https://avatars0.githubusercontent.com/u/3640638?v=4","gravatar_id":"","url":"https://api.github.com/users/peterjuras","html_url":"https://github.com/peterjuras","followers_url":"https://api.github.com/users/peterjuras/followers","following_url":"https://api.github.com/users/peterjuras/following{/other_user}","gists_url":"https://api.github.com/users/peterjuras/gists{/gist_id}","starred_url":"https://api.github.com/users/peterjuras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterjuras/subscriptions","organizations_url":"https://api.github.com/users/peterjuras/orgs","repos_url":"https://api.github.com/users/peterjuras/repos","events_url":"https://api.github.com/users/peterjuras/events{/privacy}","received_events_url":"https://api.github.com/users/peterjuras/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-09-07T15:55:53Z","updated_at":"2017-09-08T07:54:48Z","closed_at":null,"author_association":"NONE","body":"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).\r\n\r\nI found a bug where new props lead to exceptions through the componentWillReceiveProps call in RecyclerListView:\r\n\r\nWhen 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:\r\n\r\n- [RecyclerListView.js line 193](https://github.com/Flipkart/ReactEssentials/blob/recyclerlistview-master/src/recyclerlistview/RecyclerListView.js#L193)\r\n- [RecyclerListView.js line 88](https://github.com/Flipkart/ReactEssentials/blob/recyclerlistview-master/src/recyclerlistview/RecyclerListView.js#L88)\r\n\r\nAs a quick fix, I wrapped both lines in an `if (this.virtualRenderer) { ... }` and there are no more exceptions or weird behavior.\r\n\r\nYou can try out the following sample to reproduce the bug:\r\n\r\n[Sample Repo](https://github.com/peterjuras/recyclerview-receiveprops-demo)"},"comment":{"url":"https://api.github.com/repos/Flipkart/ReactEssentials/issues/comments/328029941","html_url":"https://github.com/Flipkart/ReactEssentials/issues/40#issuecomment-328029941","issue_url":"https://api.github.com/repos/Flipkart/ReactEssentials/issues/40","id":328029941,"user":{"login":"naqvitalha","id":7811728,"avatar_url":"https://avatars1.githubusercontent.com/u/7811728?v=4","gravatar_id":"","url":"https://api.github.com/users/naqvitalha","html_url":"https://github.com/naqvitalha","followers_url":"https://api.github.com/users/naqvitalha/followers","following_url":"https://api.github.com/users/naqvitalha/following{/other_user}","gists_url":"https://api.github.com/users/naqvitalha/gists{/gist_id}","starred_url":"https://api.github.com/users/naqvitalha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naqvitalha/subscriptions","organizations_url":"https://api.github.com/users/naqvitalha/orgs","repos_url":"https://api.github.com/users/naqvitalha/repos","events_url":"https://api.github.com/users/naqvitalha/events{/privacy}","received_events_url":"https://api.github.com/users/naqvitalha/received_events","type":"User","site_admin":false},"created_at":"2017-09-08T07:54:48Z","updated_at":"2017-09-08T07:54:48Z","author_association":"COLLABORATOR","body":"And thanks for the feedback, really appreciate it!"}}
{"actor":{"display_login":"naqvitalha"}}