Skip to content

Commit

Permalink
Remove no data warning (#711)
Browse files Browse the repository at this point in the history
* remove unnecessary force refresh

* Removed NO DATA warning

Co-authored-by: Talha Naqvi <talha.naqvi@shopify.com>
  • Loading branch information
naqvitalha and naqvitalha authored Apr 12, 2022
1 parent 3811633 commit cda0079
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
3 changes: 0 additions & 3 deletions src/core/RecyclerListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,6 @@ export default class RecyclerListView<P extends RecyclerListViewProps, S extends
this._processInitialOffset();
this._processOnEndReached();
this._checkAndChangeLayouts(this.props);
if (this.props.dataProvider.getSize() === 0) {
console.warn(Messages.WARN_NO_DATA); //tslint:disable-line
}
this._virtualRenderer.setOptimizeForAnimations(false);
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/constants/Constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const Constants: {[key: string]: string} = {
export const Constants = {
CONTEXT_PROVIDER_OFFSET_KEY_SUFFIX : "_offset",
CONTEXT_PROVIDER_LAYOUT_KEY_SUFFIX: "_layouts",
};
4 changes: 1 addition & 3 deletions src/core/constants/Messages.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
export const Messages: {[key: string]: string} = {
export const Messages = {
ERROR_LISTVIEW_VALIDATION : "missing datasource or layout provider, cannot proceed without it",
WARN_SCROLL_TO_INDEX: "scrollTo was called before RecyclerListView was measured, please wait for the mount to finish",
WARN_NO_DATA: "You have mounted RecyclerListView with an empty data provider (Size in 0). Please mount only if there is atleast one item " +
"to ensure optimal performance and to avoid unexpected behavior",
VISIBLE_INDEXES_CHANGED_DEPRECATED: "onVisibleIndexesChanged deprecated. Please use onVisibleIndicesChanged instead.",
ANIMATION_ON_PAGINATION: "Looks like you're trying to use RecyclerListView's layout animation render while doing pagination. " +
"This operation will be ignored to avoid creation of too many items due to developer error.",
Expand Down

0 comments on commit cda0079

Please sign in to comment.