Skip to content

Conversation

@nmbak
Copy link

@nmbak nmbak commented Oct 30, 2019

ㅠㅠ

Copy link
Owner

@yesjin-git yesjin-git left a comment

Choose a reason for hiding this comment

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

어려운 과제였는데 정말 고생하셨습니다. 노력하시고 배운 것을 활용하려는 모습이 보이는 코드였습니다.

간단한 리뷰 남겨드립니다. 구현과 관련된 내용은 정답 코드를 공유드리도록 하겠습니다.

점수는 b입니다. 늦게 리뷰 드려 죄송합니다.

savedNotes: [{content: "default1"}, {content: "default2"}]
this.state = {
savedNotes: [
{id:0, title: "title1", content: "default1", view:false},
Copy link
Owner

Choose a reason for hiding this comment

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

boolean타입의 경우 isXXX형태로 이름을 짓는 경우가 많습니다. 보기 편함도 있지만, if문 안에 들어갔을 때 바로 읽기 편하기 때문도 있습니다. ex) if(note.isVisible)

});
};

edit = index =>{
Copy link
Owner

Choose a reason for hiding this comment

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

명확하게 하기 위해 toggleEdit 과 같은 함수명으로 짓는게 좋을 것 같습니다.


handleSubmit = (e) => {
this.props.save("content")
edit2 = (writingState, index) =>{
Copy link
Owner

Choose a reason for hiding this comment

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

이런 식으로 함수 뒤에 숫자를 붙여 구분하는 형태는 좋지 않습니다. 특히나 props로 함수와 변수 모두를 내려받을 수 있기 때문에 명확하게 구분할 수 있으면 구분하는 것이 좋습니다.

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