Skip to content

Commit 0d01d00

Browse files
perf(web): the custom model editor compiles without manual memoization
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent a702563 commit 0d01d00

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

‎apps/web/src/components/settings/CustomModelEditor.tsx‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

33
import { PlusIcon, XIcon } from "lucide-react";
4-
import { useMemo, useState } from "react";
4+
import { useState } from "react";
55
import type { ProviderDriverKind, ServerProviderModel } from "@t3tools/contracts";
66
import type { CustomModelDefinition } from "@t3tools/shared/model";
77

@@ -47,13 +47,9 @@ export function CustomModelEditor({
4747
}: CustomModelEditorProps) {
4848
const [draft, setDraft] = useState<CustomModelDraft>(() => draftFromDefinition(entry));
4949
const [error, setError] = useState<string | null>(null);
50-
const presets = useMemo(
51-
() => (driverKind ? (DESCRIPTOR_PRESETS_BY_KIND[driverKind] ?? []) : []),
52-
[driverKind],
53-
);
54-
const startFromCandidates = useMemo(
55-
() => builtInModels.filter((model) => (model.capabilities?.optionDescriptors?.length ?? 0) > 0),
56-
[builtInModels],
50+
const presets = driverKind ? (DESCRIPTOR_PRESETS_BY_KIND[driverKind] ?? []) : [];
51+
const startFromCandidates = builtInModels.filter(
52+
(model) => (model.capabilities?.optionDescriptors?.length ?? 0) > 0,
5753
);
5854
const domId = (suffix: string) => `provider-instance-${instanceId}-custom-model-${suffix}`;
5955

0 commit comments

Comments
 (0)