From 4ce2da3ae628d818116fb92695f0172ddfad0682 Mon Sep 17 00:00:00 2001 From: Phoebe Lartisant Date: Wed, 22 May 2024 18:02:48 +0200 Subject: [PATCH] Use callback for domainListRest to avoid infinite re-render --- web-frontend/src/custom/useMNS.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web-frontend/src/custom/useMNS.tsx b/web-frontend/src/custom/useMNS.tsx index 1f31aa519..d51a3a483 100644 --- a/web-frontend/src/custom/useMNS.tsx +++ b/web-frontend/src/custom/useMNS.tsx @@ -63,9 +63,9 @@ export function useMNS() { setTargetMnsAddress(''); } - function resetDomainList() { + const resetDomainList = useCallback(() => { setDomainNameList([]); - } + }, []); return { domainNameList,