optimize excessive layout re-rendering due to react-router

This commit is contained in:
jeffvli
2025-11-25 01:40:11 -08:00
parent 0a6b9a1040
commit 359e442947
11 changed files with 166 additions and 161 deletions
+9 -1
View File
@@ -112,7 +112,15 @@ export const useAuthStore = createWithEqualityFn<AuthSlice>()(
),
);
export const useCurrentServerId = () => useAuthStore((state) => state.currentServer)?.id || '';
export const useCurrentServerId = () =>
useAuthStore((state) => {
const currentServer = state.currentServer;
if (!currentServer) {
return null;
}
return currentServer.id || '';
}, shallow);
export const useCurrentServer = () =>
useAuthStore((state) => {