From 7ceaefd6513baeaa3a755341f7878de07ff6b3b1 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Thu, 13 Jun 2024 16:43:38 -0300 Subject: [PATCH] Fixed if/else that is not on useEffect --- .../GenericNode/components/parameterComponent/index.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx index e7d996f0a..fb77f168e 100644 --- a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx @@ -220,10 +220,11 @@ export default function ParameterComponent({ ); } - // If optionalHandle is an empty list, then it is not an optional handle - if (optionalHandle && optionalHandle.length === 0) { - optionalHandle = null; - } + useEffect(() => { + if (optionalHandle && optionalHandle.length === 0) { + optionalHandle = null; + } + }, [optionalHandle]); const handleUpdateOutputHide = (value?: boolean) => { setNode(data.id, (oldNode) => {