Skip to content

Commit 906a3dc

Browse files
authored
fix(plugin-multi-tenant): remove unused syncTenants from useEffect deps (#14362)
https://discord.com/channels/967097582721572934/1004009734115966976/1425988296835858523 ## Change Fixes infinite loop bug in the multi-tenant plugin: `WatchTenantCollection` component causes repeated API calls to `/api/tenants/populate-tenant-options` in admin. <img width="1800" height="765" alt="image" src="https://github.com/user-attachments/assets/715541d6-5075-47eb-97f0-ce0a516d5141" /> ## Fix Remove `syncTenants` from the first useEffect dependency array.
1 parent 6c83046 commit 906a3dc

File tree

1 file changed

+1
-1
lines changed
  • packages/plugin-multi-tenant/src/components/WatchTenantCollection

1 file changed

+1
-1
lines changed

packages/plugin-multi-tenant/src/components/WatchTenantCollection/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const WatchTenantCollection = () => {
4141
if (id && titleField?.initialValue) {
4242
void syncTenantTitle()
4343
}
44-
}, [id, titleField?.initialValue, syncTenants])
44+
}, [id, titleField?.initialValue])
4545

4646
React.useEffect(() => {
4747
if (operation === 'create' && submitted) {

0 commit comments

Comments
 (0)