Skip to content

Commit

Permalink
Fixed the incorrect reference to this.props on updating VisibleIndice…
Browse files Browse the repository at this point in the history
…sChanged (#579)

* Fixed the incorrect reference to this.props

* version bump

Co-authored-by: naqvitalha <talha.naqvi@flipkart.com>
  • Loading branch information
naqvitalha and naqvitalha authored Jan 4, 2021
1 parent 5500b6b commit 449cd4e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "recyclerlistview",
"version": "3.0.4",
"version": "3.0.5-beta.1",
"description": "The listview that you need and deserve. It was built for performance, uses cell recycling to achieve smooth scrolling.",
"main": "dist/reactnative/index.js",
"types": "dist/reactnative/index.d.ts",
Expand Down
8 changes: 4 additions & 4 deletions src/core/RecyclerListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,14 @@ export default class RecyclerListView<P extends RecyclerListViewProps, S extends
public componentWillReceivePropsCompat(newProps: RecyclerListViewProps): void {
this._assertDependencyPresence(newProps);
this._checkAndChangeLayouts(newProps);
if (!this.props.onVisibleIndicesChanged) {
if (!newProps.onVisibleIndicesChanged) {
this._virtualRenderer.removeVisibleItemsListener();
}
if (this.props.onVisibleIndexesChanged) {
if (newProps.onVisibleIndexesChanged) {
throw new CustomError(RecyclerListViewExceptions.usingOldVisibleIndexesChangedParam);
}
if (this.props.onVisibleIndicesChanged) {
this._virtualRenderer.attachVisibleItemsListener(this.props.onVisibleIndicesChanged!);
if (newProps.onVisibleIndicesChanged) {
this._virtualRenderer.attachVisibleItemsListener(newProps.onVisibleIndicesChanged!);
}
}

Expand Down

0 comments on commit 449cd4e

Please sign in to comment.