-
Notifications
You must be signed in to change notification settings - Fork 0
Create Week1 Mission1 #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
hyesngy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
κ³ μ νμ ¨μ΅λλ€! ππ κ°μ μμμ μ°Έκ³ νμ¬ κ΅¬νν΄μ£Όμ κ² κ°μλ°, μ§μ ꡬνν΄λ³΄λ μκ°λ κ°μ§λ©΄ ν¬κ² λμμ΄ λ κ² μ λλ€!
μ΄λ² μ£Όμ°¨ μν¬λΆμ ν΅ν΄ Reactμμ μμ£Ό μ¬μ©λλ ts λ¬Έλ²μ λν΄ λͺ ννκ² μ΄ν΄νκ³ λμ΄κ° μ μμμΌλ©΄ μ’κ² μ΅λλ€ππ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
μ΄ νμΌμ vscode μ€μ κ΄λ ¨ νμΌμ΄λ―λ‘ μ§μμ£ΌμΈμ!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
νμΈνμ΅λλ€ λ°°μ λ κ°λ κΈ°λ°μΌλ‘ μ€μ΅ λ°λ³΅ν΄λ³΄λ©° νΌμ νμΌλ‘ ꡬνν μ μλλ‘ λ°μ νκ² μ΅λλ€!!
hyesngy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
κ³ μνμ ¨μ΅λλ€ ππ»ππ»
μ΄λ² μ£Όμ°¨μμ νμ΅ν useState, Context APIλ₯Ό μμΌλ‘λ μ νμ©ν μ μμμΌλ©΄ μ’κ² μ΅λλ€!
| // π₯ TodoContextμμ μ μ μν λ° ν¨μ κ°μ Έμ€κΈ° | ||
| const todoContext = useContext(TodoContext); | ||
|
|
||
| if (!todoContext) { | ||
| console.error("β TodoContextκ° undefinedμ λλ€."); | ||
| return <div>Contextλ₯Ό λΆλ¬μ¬ μ μμ΅λλ€.</div>; | ||
| } | ||
|
|
||
| const { todos, doneTodos, addTodo, completeTodo, deleteTodo } = todoContext; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
μ΄ λΆλΆμ TodoContext.tsxμμ λ§λ 컀μ€ν
ν
useTodoContextμ μ¬μ©νλ©΄ λ κ°κ²°ν κ² κ°μμ!
| const handleComplete = (todo: TTodo) => { | ||
| console.log("β completeTodo νΈμΆλ¨:", todo); | ||
| completeTodo(todo); | ||
| }; | ||
|
|
||
| const handleDelete = (todo: TTodo) => { | ||
| console.log("ποΈ deleteTodo νΈμΆλ¨:", todo); | ||
| deleteTodo(todo); | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
μ΄ λΆλΆμμ λ‘κΉ
μΈμλ μΆκ° κΈ°λ₯ μμ΄ Contextμ ν¨μλ₯Ό κ·Έλλ‘ νΈμΆλ§ νκ³ μμ΄, λΉν¨μ¨μ μΌλ‘ 보μ
λλ€. μ΄ λΆλΆμ μ κ±°νκ³ , μλμ TodoListμ μ§μ Context ν¨μλ₯Ό μ λ¬νλ©΄ κ°κ²°νκ³ ν¨μ¨μ μΌ κ² κ°μμ!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
μ΄ νμΌλ κΈ°μ‘΄μ νμΌμ΄λ―λ‘ μ κ±°ν΄μ£ΌμΈμ!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
μ΄ νμΌλ μ§λ μ£Όμ°¨ νμΌκ°μλ°, μ κ±° λΆνλ립λλ€!
π λ―Έμ λ²νΈ
1μ£Όμ°¨ Misson 1
π ꡬν μ¬ν
π μ€ν¬λ¦°μ·
β 체ν¬λ¦¬μ€νΈ
π€ μ§λ¬Έ μ¬ν