From bbe5ad16cabd57b8fb7fa485ee83a9b774953b76 Mon Sep 17 00:00:00 2001 From: Starstrike Date: Tue, 29 Apr 2025 21:41:22 -0400 Subject: [PATCH] Add explicit type annotations to fix TypeScript errors --- frontend/src/components/RSVPForm.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/RSVPForm.tsx b/frontend/src/components/RSVPForm.tsx index e369e22..13d5281 100644 --- a/frontend/src/components/RSVPForm.tsx +++ b/frontend/src/components/RSVPForm.tsx @@ -55,7 +55,7 @@ const RSVPForm: React.FC = () => { items = Array.isArray(response.data.needed_items) ? response.data.needed_items : typeof response.data.needed_items === 'string' - ? response.data.needed_items.split(',').map(item => item.trim()) + ? response.data.needed_items.split(',').map((item: string): string => item.trim()) : []; } @@ -93,7 +93,11 @@ const RSVPForm: React.FC = () => { const handleItemsChange = (e: SelectChangeEvent) => { const value = e.target.value; console.log('Select onChange value:', value); - const itemsArray = Array.isArray(value) ? value : typeof value === 'string' ? value.split(',').map(item => item.trim()) : []; + const itemsArray = Array.isArray(value) + ? value + : typeof value === 'string' + ? value.split(',').map((item: string): string => item.trim()) + : []; console.log('Processed items array:', itemsArray); setFormData(prev => ({ ...prev,