@etsoo/react 1.8.4 → 1.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -63,13 +63,14 @@ export const ScrollerList = (props) => {
63
63
  queryPaging,
64
64
  data
65
65
  };
66
- loadData(loadProps).then((result) => {
66
+ loadData(loadProps, stateRefs.current.lastItem).then((result) => {
67
67
  if (result == null || stateRefs.current.isMounted === false) {
68
68
  return;
69
69
  }
70
70
  stateRefs.current.isMounted = true;
71
71
  const newItems = result.length;
72
72
  stateRefs.current.lastLoadedItems = newItems;
73
+ stateRefs.current.lastItem = result.at(-1);
73
74
  stateRefs.current.hasNextPage = newItems >= batchSize;
74
75
  stateRefs.current.isNextPageLoading = false;
75
76
  if (pageAdd === 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/react",
3
- "version": "1.8.4",
3
+ "version": "1.8.5",
4
4
  "description": "TypeScript ReactJs UI Independent Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -179,7 +179,7 @@ export const ScrollerList = <T extends object>(props: ScrollerListProps<T>) => {
179
179
  data
180
180
  };
181
181
 
182
- loadData(loadProps).then((result) => {
182
+ loadData(loadProps, stateRefs.current.lastItem).then((result) => {
183
183
  if (result == null || stateRefs.current.isMounted === false) {
184
184
  return;
185
185
  }
@@ -187,6 +187,7 @@ export const ScrollerList = <T extends object>(props: ScrollerListProps<T>) => {
187
187
 
188
188
  const newItems = result.length;
189
189
  stateRefs.current.lastLoadedItems = newItems;
190
+ stateRefs.current.lastItem = result.at(-1);
190
191
  stateRefs.current.hasNextPage = newItems >= batchSize;
191
192
  stateRefs.current.isNextPageLoading = false;
192
193