From c6f6e2008e5f856f8742d55c38ee1ee520d31e68 Mon Sep 17 00:00:00 2001 From: Cristhian Zanforlin Lousa Date: Mon, 28 Aug 2023 13:52:49 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=80=20refactor(inputListComponent):=20?= =?UTF-8?q?improve=20code=20readability=20and=20handle=20value=20conversio?= =?UTF-8?q?n=20from=20string=20to=20array=20format?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 📝 WHY: The InputListComponent expects an array format for the value prop, but sometimes it receives a string instead. To prevent errors and ensure smooth operation, we need to handle the conversion from a string to an array with the string as its element. This refactor improves code readability and clarifies the purpose of the value conversion logic. --- src/frontend/src/components/inputListComponent/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/src/components/inputListComponent/index.tsx b/src/frontend/src/components/inputListComponent/index.tsx index 37d5c6e7f..105ba4c3c 100644 --- a/src/frontend/src/components/inputListComponent/index.tsx +++ b/src/frontend/src/components/inputListComponent/index.tsx @@ -18,7 +18,7 @@ export default function InputListComponent({ } }, [disabled]); - //Sometimes value is a string, but the InputListComponent expects an array, so we need to convert it when it's a string to an array with the string inside it to avoid errors + // In certain cases, the value might be in string format, whereas the InputListComponent specifically requires an array format. To ensure smooth operation and prevent potential errors, it's crucial that we handle the conversion from a string to an array with the string as its element. typeof value === 'string' ? value = [value] : value = value; return (