diff --git a/fe/src/app/eventcreate-page/page.tsx b/fe/src/app/eventcreate-page/page.tsx index 129a35c..f630150 100644 --- a/fe/src/app/eventcreate-page/page.tsx +++ b/fe/src/app/eventcreate-page/page.tsx @@ -46,6 +46,10 @@ function EventCreatePage() { setIsSubmitting(false); } }; + useEffect(() => { + setLocation(null); // selectedLocation 초기화 + setEventName(""); // eventName 초기화 + }, [setLocation]); useEffect(() => { if (uuid) router.push(`/event-maps/${uuid}`); diff --git a/fe/src/app/eventcreate-page/stores/useLocationStore.tsx b/fe/src/app/eventcreate-page/stores/useLocationStore.tsx index ced2131..2bf5f7d 100644 --- a/fe/src/app/eventcreate-page/stores/useLocationStore.tsx +++ b/fe/src/app/eventcreate-page/stores/useLocationStore.tsx @@ -9,7 +9,7 @@ interface Place { interface LocationState { selectedLocation: Place | null; - setLocation: (location: Place) => void; + setLocation: (location: Place | null) => void; } export const useLocationStore = create((set) => ({