Open
Conversation
- 숫자만 입력가능한 input type text custom hook 생성
- 누르는 button에 따라 content div 가 결정되는 기능
- useEffect이용하여 일정 시간 후 loading->done browser title 설정 - setTitle을 반환해서 이 반환된 함수가 실행될때마다 useEffect가 실행되도록 함
- onClick 이벤트가 없는 친구한테 onClick 이벤트 만들어주고 등록 - eventListener등록 후에는 등록된 이벤트 삭제 해줘야함 - clear함수는 wilUnmount단에서 삭제됨
- confirm 창 생성 확인/취소 시 상황에 맞는 callback 함수 실행
- 페이지 이동 전에 정말 이동할지 confirm창 생성 - beforeunload, event.preventDefault, event.returnValue의 조합으로 페이지 이동을 멈춘다
- duration 만큼 opacity: 0->1 로 변화하는 customhook - css만으로 구현
- scroll 이동시마다 특정행동 수행
- loading, error, data, refetch 반환
- React.Fragment - 버튼 클릭시 Modal 생성
- React.memo : 상위 컴포넌트가 갱신되어도 하위 컴포넌트의 props나 state에 변화가 없어 rerender가 필요없을때 rerender 안함 - useMemo : 2번째 parameter로 넘긴 변수가 변하지 않는 이상 rerender되어도 computed 변수를 다시 계산하지 않는다 - useCallback : 2번째 paramter로 내부에서 사용하는 state, props를 넣어준다.
- useReducer를 이용한 customhook 생성 - api fetching상태, success상태, error상태 구분하는 state반환 - api fetch method 반환
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.
No description provided.