Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 |
Tags
- locale data
- custom hook
- react
- 백준
- typescript
- useMemo
- 프로그래머스
- React-hook-form
- ZOD
- 피보나치 함수
- Python
- context api
- 이메일 인증
- Flutter
- next.js
- 리팩토링
- storybook
- React.memo
- Github Actions
- 사탕게임
- visual test
- javascript
- suffixicon
- interaction test
- Props Drilling
- Vanilla JavaScript
- TextFormField
- useEffect
- kakao blind recruitment
- next-auth
Archives
- Today
- Total
목록context api (1)
sik9252
Context API로 너무 많은 props drilling 개선하기
* 여기서 구현한 RegisterAlarmDialog는 후에 SimpleAlarmDialog 라는 더 큰 범위의 공통 컴포넌트로 교체되었다. 진행중인 프로젝트에서 Dialog(모달창)를 사용할 일이 많았다. 그래서 useDialog()라는 hook을 만들어 여러 곳에서 재사용 할 수 있도록 하려고 했다. 그래서 아래와 같은 코드를 구현했는데...import { useState, useCallback } from "react";const useDialog = () => { const [isDialogOpen, setIsDialogOpen] = useState(false); const open = useCallback(() => setIsDialogOpen(true), []); const close =..
Trouble Shooting
2024. 10. 9. 17:26