diff --git a/src/context/profile.tsx b/src/context/profile.tsx index 8d05861e..04d3c43a 100644 --- a/src/context/profile.tsx +++ b/src/context/profile.tsx @@ -45,8 +45,10 @@ const useProfileForm = () => { const updateFormField = (fieldName: string, value: string, remove?: boolean) => { if (fieldName === 'links') { if (remove) { - //FIXME: TS Error: error Unnecessarily cloning an array unicorn/no-useless-spread - setForm((prev) => ({ ...prev, links: [...prev.links.filter((item) => item !== value)] })) + setForm( + 'links', + form.links.filter((item) => item !== value) + ) } else { setForm((prev) => ({ ...prev, links: [...prev.links, value] })) }