From 57ec1e82f0a9a730716b8457aae865e3bbb0e111 Mon Sep 17 00:00:00 2001 From: ilya-bkv Date: Thu, 1 Dec 2022 22:28:43 +0300 Subject: [PATCH] Linter fixies --- src/context/profile.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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] })) }