-
Notifications
You must be signed in to change notification settings - Fork 1
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
과제 완료 - 한슬희 #5
base: main
Are you sure you want to change the base?
과제 완료 - 한슬희 #5
Conversation
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.
👍 👍 👍 👍
고생하셨어요!! 👍 👍
src/Todo.tsx
Outdated
</form> | ||
<ul className="listUl"> | ||
{todos.map((todo: ITodo) => | ||
<li key={todo.id} className="list"><input type="checkbox"/>{todo.summary}</li> |
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.
과제에서 요구한 사항은 id까지 렌더링하는 거긴 했는데 !!
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.
😮😮😮 그랬나요 ?!
src/Todo.tsx
Outdated
const [newTodos, setNewTodos] = useState<string>(""); | ||
|
||
function onSubmitForm(event: FormEvent<HTMLFormElement>) { | ||
event?.preventDefault(); |
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.
여기서는 옵셔널 체이닝이 필요 없을 거 같아요!
event?.preventDefault(); | |
event.preventDefault(); |
src/Todo.tsx
Outdated
} | ||
|
||
function onChangeInput(event: ChangeEvent<HTMLInputElement>) { | ||
setNewTodos(Object(event.target.value)); |
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.
여기서 Object 형식으로 wrapping하는 이유가 뭔가요??
newTodos
는 string type인데, object 형태로 하신 이유가 있을까요??
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.
실수용 ㅠ
src/Todo.tsx
Outdated
|
||
function Todo() { | ||
const [todos, setTodos] = useState<ITodo[]>([]); | ||
const [newTodos, setNewTodos] = useState<string>(""); |
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.
현재 이 state는 추가될 한 가지의 상태의 입력 값
을 저장하고 있는 걸로 보여요.
근데 이름이 복수형으로 되어있어 혼란을 야기할 수 있는 이름인 거 같아요 !
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.
OMG 😅👍👍
No description provided.