From abac554e95859b0d5c8e8741517ce4efd1db6034 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi <256895@studenti.unimore.it> Date: Tue, 11 May 2021 23:44:14 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20possible=20bug=20in=20useA?= =?UTF-8?q?rrayState?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/frontend/src/hooks/useArrayState.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/code/frontend/src/hooks/useArrayState.js b/code/frontend/src/hooks/useArrayState.js index d52daf8..e150ef3 100644 --- a/code/frontend/src/hooks/useArrayState.js +++ b/code/frontend/src/hooks/useArrayState.js @@ -25,9 +25,8 @@ export default function useArrayState(def) { console.debug("Splicing ", position, " from ArrayState") setValue( oldArray => { - // TODO: Hope this doesn't break anything... oldArray.splice(position, 1) - return oldArray + return [...oldArray] }, ) },