Skip to content
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

전병주 과제 #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ByeongJu-Jeon
Copy link

No description provided.

Comment on lines +16 to +18
const InputChange = (event: React.ChangeEvent<HTMLInputElement>) => {
setInputValue(event.target.value);
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 부분에서 event: 는 e로 축약해서 적을 수 있어요!

};

function App() {
const [count, setCount] = useState(0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

할 일 개수를 관리하는 이 count 상태가 꼭 필요한지 생각해보세요!

const[count, setCount] = useState<number>(0);

이렇게 타입과 초기값을 명확히 추가하시는게 좋아요!

Comment on lines +35 to +39
const DeleteItem = (id: number) => {
const updatedList = itemList.filter((_, idx) => idx !== id);
setItemList(updatedList);
setCount(count - 1);
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filter(_, idx) 부분에서 _ 이건 무엇을 의미하나요?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants