Skip to content

Commit fea0cc6

Browse files
committed
fix: 회원가입 뒤로가기 오류 수정3
1 parent 53d1166 commit fea0cc6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/app/signup/page.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ const SignupPage: React.FC = () => {
6666

6767
const handleNext = () => {
6868
setCurrentStep((prev) => prev + 1);
69+
// window.history.pushState(
70+
// { step: currentStep + 1 },
71+
// '',
72+
// `/signup?step=${currentStep + 1}`
73+
// );
6974
};
7075

7176
const handleUpdate = (data: Partial<typeof formData>) => {
@@ -105,6 +110,12 @@ const SignupPage: React.FC = () => {
105110
}
106111
};
107112

113+
useEffect(() => {
114+
const searchParams = new URLSearchParams(window.location.search);
115+
const stepFromUrl = parseInt(searchParams.get('step') || '1', 10);
116+
setCurrentStep(stepFromUrl);
117+
}, []);
118+
108119
useEffect(() => {
109120
const handleBeforeUnload = (e: BeforeUnloadEvent) => {
110121
e.preventDefault();

0 commit comments

Comments
 (0)