Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
느낌점: 저번주 과제와는 다르게 React와 Tailwind CSS는 처음 다뤄보기 때문에 시작부터 어려웠습니다. HTML / CSS / JS는 각각 파일을 구성하고 시작하는 것에 비해 React는 CLI를 통해 Vite와 결합된 파일을 만들어야 했습니다. 그리고 내부의 파일 구성 또한, 이전과는 다른 형태인 점에서도 난관을 겪었습니다. 일주일이 생각보다 짧아 React와 Tailwind CSS를 공부하기에 시간이 부족하여 다크 모드 등 일부 기능들을 이전 과제와 100% 동일하게 구현하지 못한 점이 아쉬웠습니다.
이전 과제 기능 중 input를 한국어로 받을 때 중복으로 입력되었던 부분은
isComposing을 이용하여 입력 중 일 때는 입력을 받지 않고, 입력이 끝났을 때 등록되도록 리팩토링 했으며, 날짜 변경에서 일부 코드가 동일한 부분은 인자를 받도록 수정하였습니다.또한, 지난 과제에서 Vercel를 통한 배포가 되지 않아 Github에서 배포를 진행하였습니다. 그러나 Github를 통해서 이후 대규모 과제에서 배포가 어려울 것이라는 조언을 통해 Vercel를 통해 배포를 진행하려고 했습니다. 배포 처음에는 Branch가 master로 설정되어 변경해도 이동하지 않아 여러 방법을 시도했습니다. 실제 파일 변경이 없더라도 새로운 커밋을 강제로 생성하여 연결된 Vercel 프로젝트의 자동배포 트리거로 사용하기 위해 새로운 커밋을 집어넣은 것이 효과가 있었으며, 정상적으로 배포를 마무리하였습니다.
초기 구성:
배포링크
Review Questions
1) Virtual-DOM은 무엇이고, 이를 사용함으로서 얻는 이점은 무엇인가요?
Virtual DOM : UI 효율성을 극대화하기 위해 DOM의 가벼운 복사본을 메모리 상에서 유지 관리하는 기술
작동 방식 :
2) React.memo(), useMemo(), useCallback() 함수로 진행할 수 있는 리액트 렌더링 최적화에 대해 설명해주세요. 다른 방식이 있다면 이에 대한 소개도 좋습니다.
React.memo()
React.memo()로 래핑 될 때, React는 컴포넌트를 렌더링하고 결과를 Memoizing함. 그 다음 렌더링이 일어날 때 props가 같다면 Memoizing된 내용을 재사용함.React.memo()는 함수형 컴퍼넌트에 적용되어 같은 props에 같은 렌더링 결과를 제공함. 따라서 같은 props로 자주 렌더링 될 때 해당 함수로 래핑하는 것이 좋음.useMemo()
useCallback()
3) React 컴포넌트 생명주기에 대해서 설명해주세요.
생명주기 : 컴포넌트가 생성되고 사용되고 소멸될 때까지 일련의 과정
라이프 사이클 이벤트 : 생명주기 안에서 특정 시점에 자동으로 호출되는 메서드
라이프 사이클 이벤트 분류