diff --git a/apps/sn/app/components/ui/verticalTable.tsx b/apps/sn/app/components/ui/verticalTable.tsx index dc024e068..14c61bec8 100644 --- a/apps/sn/app/components/ui/verticalTable.tsx +++ b/apps/sn/app/components/ui/verticalTable.tsx @@ -67,15 +67,7 @@ export function VerticalTable({ }: UiTableProps) { const [cur, setCur] = useState(1); const [formData, setFormData] = useState<{ [key: string]: string | number | boolean }>({}); - const [errors, setErrors] = useState<{ [key: string]: string }>({}); // 에러 상태 추가 - - // 컴포넌트 언마운트 시 confirmToast 정리 - useEffect(() => { - return () => { - // 컴포넌트가 언마운트될 때 global-confirm-toast ID를 가진 Toast 제거 - toast.dismiss("global-confirm-toast"); - }; - }, []); + const [errors, setErrors] = useState<{ [key: string]: string }>({}); useEffect(() => { if (resetPageNo) { @@ -86,23 +78,19 @@ export function VerticalTable({ useEffect(() => { if (tableData.length > 0 && tableData[0]) { - // 깊은 복사를 통해 새로운 객체 생성 const newData = JSON.parse(JSON.stringify(tableData[0])); setFormData(newData); - console.log("Form data initialized:", newData); // 디버깅용 + setErrors({}); } }, [tableData]); const handleInputChange = (id: string, value: string | number | boolean) => { - console.log(`Input change: ${id} = ${value}`); // 디버깅용 const newFormData = { ...formData, [id]: value, }; - console.log("New form data:", newFormData); // 디버깅용 setFormData(newFormData); - // 에러 메시지 초기화 (입력이 성공하면 에러 제거) if (errors[id]) { setErrors(prev => { const newErrors = { ...prev }; @@ -111,7 +99,6 @@ export function VerticalTable({ }); } - // 폼 데이터가 변경될 때마다 부모에게 알림 if (onFormDataChange) { onFormDataChange(newFormData); }