-
Notifications
You must be signed in to change notification settings - Fork 35
2week #73
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
base: 2week
Are you sure you want to change the base?
2week #73
Conversation
yesjin-git
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.
B+ 드립니다.
잘 시도해주셨습니다. 지난 시간에 배우신 내용들은 잘 숙지하고 계신 것 같습니다.
커맨트 드린바와 같이 삼항연산자와 &&, || 를 사용해보시면 더욱 좋을 것 같습니다.
https://reactjs.org/docs/conditional-rendering.html
| {id: 2, title: "title3", content: "default3"} | ||
| {id: 0, title: "title1", content: "default1", isFocused: false}, | ||
| {id: 1, title: "title2", content: "default2", isFocused: false}, | ||
| {id: 2, title: "title3", content: "default3", isFocused: false} |
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.
isFocused는 note 내부에 state로 관리하는 편이 더 깔끔할 것 같습니다. app에서 isFocused를 알고 있지 않아도 되기 때문입니다. 답안을 참고해주세요.
| {this.state.savedNotes.map((note, index) => ( | ||
| <Note | ||
| delete={this.delete} | ||
| edit={this.isFocused} |
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.
코드 작성중에 끊기셔서 이런 부분이 나온 것 같습니다.
| this.setState({ | ||
| isEditFocused: false | ||
| }) | ||
| console.log(this.props.index + "is not focused") |
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.
처음에는 이렇게 리뷰를 달면서 작업하는게 좋습니다. 잘하셨습니다.
| render() { | ||
| const {title, content} = this.props | ||
| const editFocus = this.state.isEditFocused | ||
| if (!editFocus) { |
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.
이 부분은 삼항연산자를 활용하는 것을 연습해보시면 더 좋을 것 같습니다.
마찬가지로 && 와 || 도 활용해보세요.(답안을 참고하시면 사용 예제가 있습니다.
도저히 모르겠어서 일단 제출합니다 ㅠ_ㅠ