@etsoo/react 1.8.78 → 1.8.79

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.
@@ -158,7 +158,7 @@ const ScrollerList = (props) => {
158
158
  localRef.current?.scrollToRow(param);
159
159
  }
160
160
  };
161
- }, []);
161
+ }, [rows]);
162
162
  // When layout ready
163
163
  react_1.default.useEffect(() => {
164
164
  // Return clear function
@@ -152,7 +152,7 @@ export const ScrollerList = (props) => {
152
152
  localRef.current?.scrollToRow(param);
153
153
  }
154
154
  };
155
- }, []);
155
+ }, [rows]);
156
156
  // When layout ready
157
157
  React.useEffect(() => {
158
158
  // Return clear function
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/react",
3
- "version": "1.8.78",
3
+ "version": "1.8.79",
4
4
  "description": "TypeScript ReactJs UI Independent Framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -231,40 +231,36 @@ export const ScrollerList = <T extends object>(props: ScrollerListProps<T>) => {
231
231
  if (stateRefs.current.isMounted !== false) setRows(items, true);
232
232
  };
233
233
 
234
- React.useImperativeHandle(
235
- mRef,
236
- () => {
237
- return {
238
- get element() {
239
- return localRef.current?.element;
240
- },
241
- delete(index) {
242
- const item = rows.at(index);
243
- if (item) {
244
- const newRows = [...rows];
245
- newRows.splice(index, 1);
246
- setRows(newRows);
247
- }
248
- return item;
249
- },
250
- insert(item, start) {
234
+ React.useImperativeHandle(mRef, () => {
235
+ return {
236
+ get element() {
237
+ return localRef.current?.element;
238
+ },
239
+ delete(index) {
240
+ const item = rows.at(index);
241
+ if (item) {
251
242
  const newRows = [...rows];
252
- newRows.splice(start, 0, item);
243
+ newRows.splice(index, 1);
253
244
  setRows(newRows);
254
- },
255
- refresh(): void {
256
- loadDataLocal(0);
257
- },
245
+ }
246
+ return item;
247
+ },
248
+ insert(item, start) {
249
+ const newRows = [...rows];
250
+ newRows.splice(start, 0, item);
251
+ setRows(newRows);
252
+ },
253
+ refresh(): void {
254
+ loadDataLocal(0);
255
+ },
258
256
 
259
- reset,
257
+ reset,
260
258
 
261
- scrollToRow(param: ScrollToRowParam): void {
262
- localRef.current?.scrollToRow(param);
263
- }
264
- };
265
- },
266
- []
267
- );
259
+ scrollToRow(param: ScrollToRowParam): void {
260
+ localRef.current?.scrollToRow(param);
261
+ }
262
+ };
263
+ }, [rows]);
268
264
 
269
265
  // When layout ready
270
266
  React.useEffect(() => {