Fix infinite loop on table load (#12474)
This was a tough one: - we should avoid updating lazy findManyRecords function with onCompleted callback, this is prone to infinite loops
This commit is contained in:
@ -94,8 +94,6 @@ export const useLazyFindManyRecords = <T extends ObjectRecord = ObjectRecord>({
|
||||
set(hasNextPageFamilyState(queryIdentifier), false);
|
||||
set(cursorFamilyState(queryIdentifier), '');
|
||||
|
||||
onCompleted?.([]);
|
||||
|
||||
return {
|
||||
data: null,
|
||||
loading: false,
|
||||
@ -124,7 +122,6 @@ export const useLazyFindManyRecords = <T extends ObjectRecord = ObjectRecord>({
|
||||
findManyRecords,
|
||||
objectMetadataItem.namePlural,
|
||||
queryIdentifier,
|
||||
onCompleted,
|
||||
],
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user