Skip to content
TypeScript

perf(web): the CLI command settings row compiles without manual memoization (#20583)

Julius Marmingef0e060a3865d
diff --git a/apps/web/src/components/settings/CliCommandSettingsRow.tsx b/apps/web/src/components/settings/CliCommandSettingsRow.tsx
index 0be28317454..b7d98628591 100644
--- a/apps/web/src/components/settings/CliCommandSettingsRow.tsx
+++ b/apps/web/src/components/settings/CliCommandSettingsRow.tsx
@@ -1,5 +1,5 @@
import type { DesktopCliCommandState } from "@t3tools/contracts";
-import { useCallback, useEffect, useState } from "react";
+import { useEffect, useState } from "react";
import { Button } from "../ui/button";
import { stackedThreadToast, toastManager } from "../ui/toast";
@@ -25,25 +25,22 @@ export function CliCommandSettingsRow() {
};
}, [bridge]);
- const change = useCallback(
- (action: "install" | "uninstall") => {
- if (!bridge || pending) return;
- setPending(true);
- void bridge[action]()
- .then(setState)
- .catch((error: unknown) => {
- toastManager.add(
- stackedThreadToast({
- type: "error",
- title: action === "install" ? "Could not install t3" : "Could not remove t3",
- description: error instanceof Error ? error.message : "Something went wrong.",
- }),
- );
- })
- .finally(() => setPending(false));
- },
- [bridge, pending],
- );
+ const change = (action: "install" | "uninstall") => {
+ if (!bridge || pending) return;
+ setPending(true);
+ void bridge[action]()
+ .then(setState)
+ .catch((error: unknown) => {
+ toastManager.add(
+ stackedThreadToast({
+ type: "error",
+ title: action === "install" ? "Could not install t3" : "Could not remove t3",
+ description: error instanceof Error ? error.message : "Something went wrong.",
+ }),
+ );
+ })
+ .finally(() => setPending(false));
+ };
if (!bridge || !state?.supported) return null;
const installed = state.installedPath !== null;