diff --git a/spinifex/services/spinifexui/frontend/src/components/elbv2/attributes-editor.tsx b/spinifex/services/spinifexui/frontend/src/components/elbv2/attributes-editor.tsx index 5f067f353..b1226f110 100644 --- a/spinifex/services/spinifexui/frontend/src/components/elbv2/attributes-editor.tsx +++ b/spinifex/services/spinifexui/frontend/src/components/elbv2/attributes-editor.tsx @@ -1,4 +1,4 @@ -import { useMemo, useState } from "react" +import { useState } from "react" import { Button } from "@/components/ui/button" import { Field, FieldError, FieldTitle } from "@/components/ui/field" @@ -99,10 +99,7 @@ export function AttributesEditor({ error, isSuccess, }: AttributesEditorProps) { - const initial = useMemo( - () => buildInitial(specs, attributes), - [specs, attributes], - ) + const initial = buildInitial(specs, attributes) const [values, setValues] = useState(initial) const setValue = (key: string, value: string) => { diff --git a/spinifex/services/spinifexui/frontend/src/components/elbv2/security-groups-editor.tsx b/spinifex/services/spinifexui/frontend/src/components/elbv2/security-groups-editor.tsx index f8725bd3a..ecf5d3935 100644 --- a/spinifex/services/spinifexui/frontend/src/components/elbv2/security-groups-editor.tsx +++ b/spinifex/services/spinifexui/frontend/src/components/elbv2/security-groups-editor.tsx @@ -1,5 +1,5 @@ import type { SecurityGroup } from "@aws-sdk/client-ec2" -import { useMemo, useState } from "react" +import { useState } from "react" import { Button } from "@/components/ui/button" @@ -30,7 +30,7 @@ export function SecurityGroupsEditor({ error, isSuccess, }: SecurityGroupsEditorProps) { - const initial = useMemo(() => [...current], [current]) + const initial = [...current] const [selected, setSelected] = useState(initial) const toggle = (id: string) => { diff --git a/spinifex/services/spinifexui/frontend/src/components/elbv2/subnets-editor.tsx b/spinifex/services/spinifexui/frontend/src/components/elbv2/subnets-editor.tsx index 93ba2c6bf..a09d62d01 100644 --- a/spinifex/services/spinifexui/frontend/src/components/elbv2/subnets-editor.tsx +++ b/spinifex/services/spinifexui/frontend/src/components/elbv2/subnets-editor.tsx @@ -1,5 +1,5 @@ import type { Subnet } from "@aws-sdk/client-ec2" -import { useMemo, useState } from "react" +import { useState } from "react" import { Button } from "@/components/ui/button" import { getNameTag } from "@/lib/utils" @@ -38,7 +38,7 @@ export function SubnetsEditor({ error, isSuccess, }: SubnetsEditorProps) { - const initial = useMemo(() => [...current], [current]) + const initial = [...current] const [selected, setSelected] = useState(initial) const toggle = (id: string) => { diff --git a/spinifex/services/spinifexui/frontend/src/components/elbv2/tags-editor.tsx b/spinifex/services/spinifexui/frontend/src/components/elbv2/tags-editor.tsx index 23fec300e..328d03c52 100644 --- a/spinifex/services/spinifexui/frontend/src/components/elbv2/tags-editor.tsx +++ b/spinifex/services/spinifexui/frontend/src/components/elbv2/tags-editor.tsx @@ -1,5 +1,5 @@ import { Plus, Trash2 } from "lucide-react" -import { useMemo, useState } from "react" +import { useState } from "react" import { Button } from "@/components/ui/button" import { Input } from "@/components/ui/input" @@ -43,7 +43,7 @@ export function TagsEditor({ error, isSuccess, }: TagsEditorProps) { - const initialRows = useMemo(() => buildInitialRows(tags), [tags]) + const initialRows = buildInitialRows(tags) const [rows, setRows] = useState(initialRows) const [nextId, setNextId] = useState(initialRows.length) diff --git a/spinifex/services/spinifexui/frontend/src/components/gpu-instance-type-select.tsx b/spinifex/services/spinifexui/frontend/src/components/gpu-instance-type-select.tsx index 107018705..20c836ed6 100644 --- a/spinifex/services/spinifexui/frontend/src/components/gpu-instance-type-select.tsx +++ b/spinifex/services/spinifexui/frontend/src/components/gpu-instance-type-select.tsx @@ -75,6 +75,8 @@ export function GpuInstanceTypeSelect({ className, "aria-invalid": ariaInvalid, }: GpuInstanceTypeSelectProps) { + // Pins the dedupe and sort to instanceTypes; without it the compiler widens + // the scope to every prop and redoes the work on each selection change. const { standardEntries, gpuEntries } = useMemo(() => { const entries = dedupeInstanceTypes(instanceTypes) return {