Skip to content

Commit

Permalink
Fix: 경로 수정, getValues -> watch로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
eunji-0623 committed Jul 19, 2024
1 parent 93b23b4 commit dd95075
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/MyActivity/Register/RegisterForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import AddressInput from '@/components/MyActivity/Register/AddressInput';
import { useEffect } from 'react';
import { RegisterFormProps } from './RegisterForm.types';
import useEditMyActivity from '@/hooks/myActivity/useEditMyActivity';
import useResetRegisterState from '../../../hooks/myActivity/useResetRegisterState';
import useResetRegisterState from '@/hooks/myActivity/useResetRegisterState';

function RegisterForm({ activityData, isEdit = false }: RegisterFormProps) {
const [selectedKateogorie, setSelectedKategorie] =
Expand All @@ -46,7 +46,7 @@ function RegisterForm({ activityData, isEdit = false }: RegisterFormProps) {
register,
handleSubmit,
setValue,
getValues,
watch,
formState: { errors },
} = useForm<FieldValues>({
mode: 'onChange',
Expand Down Expand Up @@ -157,7 +157,7 @@ function RegisterForm({ activityData, isEdit = false }: RegisterFormProps) {

// form 제출이 가능한지 체크
const isAllFieldsValid = () => {
const { title, description, price } = getValues();
const { title, description, price } = watch();
return (
!!title &&
!!description &&
Expand Down

0 comments on commit dd95075

Please sign in to comment.