Skip to content
TypeScript

perf(web): the managed relay hooks compile without manual memoization (#20552)

Julius Marminge22585fd9ff70
diff --git a/apps/web/src/cloud/managedRelayState.ts b/apps/web/src/cloud/managedRelayState.ts
index 35c3703626a..ecff5d2ae8f 100644
--- a/apps/web/src/cloud/managedRelayState.ts
+++ b/apps/web/src/cloud/managedRelayState.ts
@@ -19,7 +19,7 @@ import * as Context from "effect/Context";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import { AsyncResult, Atom } from "effect/reactivity";
-import { useCallback, useEffect } from "react";
+import { useEffect } from "react";
import { runtime } from "../lib/runtime";
import { appAtomRegistry } from "../rpc/atomRegistry";
@@ -75,11 +75,11 @@ export function useManagedRelayEnvironments() {
});
}
}, [snapshot.error, snapshot.errorTraceId]);
- const refresh = useCallback(() => {
+ const refresh = () => {
if (accountId) {
managedRelayQueryManager.refreshEnvironments(appAtomRegistry, accountId);
}
- }, [accountId]);
+ };
return {
...snapshot,
@@ -102,11 +102,11 @@ export function useManagedRelayDevices() {
});
}
}, [snapshot.error, snapshot.errorTraceId]);
- const refresh = useCallback(() => {
+ const refresh = () => {
if (accountId) {
managedRelayQueryManager.refreshDevices(appAtomRegistry, accountId);
}
- }, [accountId]);
+ };
return {
...snapshot,