-
Notifications
You must be signed in to change notification settings - Fork 6
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주차 과제 제출... #6
base: main
Are you sure you want to change the base?
5주차 과제 제출... #6
Conversation
const addTodo = (): void => { | ||
if (input.trim() === "") { | ||
alert("등록할 일정을 입력해주세요!"); | ||
return; | ||
} | ||
const newTodo: Todo = { | ||
id: Date.now(), | ||
todoText: input, | ||
isDone: false, | ||
}; | ||
setTodos([...todos, newTodo]); | ||
setInput(""); | ||
}; | ||
|
||
const toggleTodo = (id: number): void => { | ||
setTodos( | ||
todos.map((todo) => | ||
todo.id === id ? { ...todo, isDone: !todo.isDone } : todo | ||
) | ||
); | ||
}; | ||
|
||
const deleteTodo = (id: number): void => { | ||
setTodos(todos.filter((todo) => todo.id !== 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.
함수의 반환값이 없다는 것을 명시적으로 작성해주셨네요!
명시적으로 작성해주신 이유가 있으실까요?
const TodoList: React.FC = () => { | ||
const [todos, setTodos] = useState<Todo[]>([]); | ||
const [input, setInput] = 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.
React.FC가 무엇인가요? 이렇게 작성하신 이유도 알려주세요
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.
- 과제 피드백
- 과제에서 요구하는 기능은 전부 구현하셨지만 스타일 부분이 많이 다른 것 같아요
- 할 일 일정 체크시 표시되는 선이 삭제버튼까지 표시됩니다!
Description
Important content
Question
Reference