inflearn logo
강의

Course

Instructor

React Master Class: Part 1 - Understanding the Essence of Rendering and Design Through Missions

[Must-Read] 🟫 Section 7. Advanced State Management and Form Control - Learning Guide

state 객체로 묶기

8

potato9801245279

8 asked

0

mport { useState } from"react"; functionSignupForm() { const [username, setUsername] = useState(""); const [email, setEmail] = useState(""); const [agree, setAgree] = useState(false); functionhandleSubmit(e) { e.preventDefault(); // 페이지 새로고침 방지console.log("제출 데이터:", { username, email, agree }); alert${username}님, 가입이 완료되었습니다!); } return ( <formonSubmit={handleSubmit}><label> 사용자 이름 <inputtype="text"value={username}onChange={(e) => setUsername(e.target.value)} /> </label><br /><label> 이메일 <inputtype="email"value={email}onChange={(e) => setEmail(e.target.value)} /> </label><br /><label><inputtype="checkbox"checked={agree}onChange={(e) => setAgree(e.target.checked)} /> 약관에 동의합니다 </label><br /><buttontype="submit">가입하기</button></form> ); }

 

이학습 코드에선 왜
const [username, setUsername] = useState(""); const [email, setEmail] = useState(""); const [agree, setAgree] = useState(false);

이부분들을 객체로 안 묶고 따로 state로 관리 하는지가 궁금합니다!

HTML/CSS javascript react 웹앱 frontend

Answer 0

claude code가 작업중일때 ctrl t 눌러서 진행상황 확인 불가

0

4

0

메타프롬프트 관련

0

9

1

mcp관련 질문입니다!

0

9

0

ZIP 파일

0

10

2

side bar positon. 어떻게 해도 안돼요..;

0

9

1

26강 13F 강의 불일치 및 질문 요청

0

15

3

모델 고정방법 문의

0

9

1

98강. 1인 사이드프로젝트 시 질문

0

13

1

강의화면과 Cursor프로그램 화면이 달라서요..

0

12

1

커서 설치했는데 이해 안되네요

0

15

1

공식사이트 관련과 workspace

0

14

1

수업 잘 들었습니다.

2

16

2

user-memory-setup 저장 관련

0

12

1

user-memory-setup 작성하고 클로드 코드로 돌아가는 방법

0

12

1

에러화면 질의

0

14

1

[미션6] output-style 위치 변경

0

12

1

아래 에러가 나는 경우의 대처법

0

13

1

이전 커밋으로 롤백을 하고 다시 롤백하기 전 커밋으로 돌아가려고 하는데 그래프 패널에서 main이 사라져 버립니다.

0

13

1

CLAUDE.md 에 import 문법 질문

0

19

1

Github 404 Error

0

21

1

/update-roadmap 는 언제 어떻게 사용하는건지요?

0

24

2

깃 관련질문입니다!

0

27

2

53강 질문

0

31

2

styled-components(전역)

0

24

0