-
Notifications
You must be signed in to change notification settings - Fork 8
[3주차] 김상준 학습 PR 제출합니다. #10
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: main
Are you sure you want to change the base?
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.
수고하셨습니다!
week2/김상준/todo/src/TodoApp.jsx
Outdated
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.
.trim()
은 무엇을 하나요?
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.
문자열 양쪽 끝의 공백을 제거합니다.
week2/김상준/todo/src/TodoApp.jsx
Outdated
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.
외부 라이브러리를 사용하지 않고 랜덤성 있고 중복 없이 사용하려고 설정한건데 uuid를 사용하는 방법이 더 나을 것 같습니다.
week2/김상준/todo/src/TodoApp.jsx
Outdated
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.
createdAt은 뭔가요??
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.
나중에 확장성을 생각해서 할 일 목록의 생성 시점을 기록하는 것입니다.
week2/김상준/todo/src/TodoApp.jsx
Outdated
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.
autoFocus의 역할은 무엇인가요?
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.
수정 버튼을 눌렀을 때 수정해야 하는 텍스트 칸에 바로 커서가 생기도록 하는 역할입니다.
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.
고생하셨습니다! PR을 보니 컴포넌트 분리를 하지 않고 한 컴포넌트에 모두 넣으셨던데 그렇게 하면 좋은점이 무엇인지 그렇게 하신 이유가 무엇인지 궁금합니다!
week2/김상준/[2주차] 김상준.md
Outdated
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.
확인했습니다!
week2/김상준/[2주차] 김상준.md
Outdated
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.
props의 예시도 보여주시면 좋을 거 같아요!
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.
다음 학습 내용부터는 예시도 조금 더 신경써보도록 하겠습니다. 컴포넌트와 파일 분리의 경우 생각은 했었는데 다음 차시에 차차 적용하는게 나을 것 같아서 이번 차시에는 반영하지 않았었습니다.
week2/김상준/todo/tailwind.config.js
Outdated
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.
테일윈드를 쓰신 이유가 있을까요??
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.
따로 css파일에서 직접 스타일 코드를 작성하지 않아도 되는 점이 이 프로젝트랑은 잘 맞을 것 같아서 사용해봤습니다.
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.
고생하셨습니다!
week2/김상준/todo/src/TodoApp.jsx
Outdated
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.
JSON.parse() 정확히 어떤 역할을 하나요?
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.
json형식의 문자열을 js의 객체나 배열 형태로 바꿔줍니다.
week2/김상준/todo/src/TodoApp.jsx
Outdated
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.
try-catch로 감싸셨는데 현재 코드 기준 localStorage를 읽어올 때 어떤 에러가 날 수 있을까요?
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.
localStorage에 저장된 JSON 값의 형식이 외부의 개입 등의 이유로 이상해질 경우 값이 날아가는 경우가 생길 수 있을 것 같습니다.
week2/김상준/todo/src/TodoApp.jsx
Outdated
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.
[todos]가 왜 필요한가요? 빈 배열 []을 쓰거나 아예 안 쓰면 어떻게 될까요?
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.
useState과 useEffect를 사용해서 값이 변경될 경우 리렌더링을 하고 localStorage에 최신 상태를 저장하고 있는데 빈 배열을 사용하거나 아예 사용하지 않는 경우 초기화 할 때만 사용되거나 비효율적으로 localStorage와 동기화 작업을 실행하게 됩니다.
✅ 학습 내용 요약
리액트의 훅에 대해서 공부했습니다.
🤔 고민했던 부분
정확히 훅이 리액트 내부적으로 어떤 작동을 하는지에 대해서 이해하려고 많이 노력했던 것 같습니다.
🔊 도움이 필요한 부분