Only call useEffect on mounted

This commit is contained in:
redphx
2025-02-07 21:32:18 +07:00
parent 3c2549178b
commit 585ee82776
3 changed files with 3 additions and 3 deletions

View File

@@ -5179,7 +5179,7 @@ class PatcherUtils {
return str.substring(start, end);
}
static injectUseEffect(str, index, group, eventName) {
let newCode = `window.BX_EXPOSED.reactUseEffect(() => window.BxEventBus.${group}.emit('${eventName}', {}));`;
let newCode = `window.BX_EXPOSED.reactUseEffect(() => window.BxEventBus.${group}.emit('${eventName}', {}), []);`;
return str = PatcherUtils.insertAt(str, index, newCode), str;
}
}