본문 바로가기

Dev Diary

검색하기
Dev Diary
프로필사진 sik9252

  • 분류 전체보기 (32)
    • Algorithms (13)
    • Projects (9)
    • DevOps (1)
    • Trouble Shooting (8)
    • 기타 (1)
Guestbook
Notice
Recent Posts
Recent Comments
Link
«   2025/05   »
일 월 화 수 목 금 토
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
  • javascript
  • Python
  • React-hook-form
  • interaction test
  • custom hook
  • context api
  • next-auth
  • useEffect
  • 사탕게임
  • useMemo
  • 피보나치 함수
  • 백준
  • Props Drilling
  • next.js
  • typescript
  • 리팩토링
  • react
  • 프로그래머스
  • suffixicon
  • locale data
  • TextFormField
  • Github Actions
  • storybook
  • Flutter
  • ZOD
  • Vanilla JavaScript
  • kakao blind recruitment
  • 이메일 인증
  • visual test
  • React.memo
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록Props Drilling (1)

Dev Diary

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
이전 Prev 1 Next 다음

Blog is powered by kakao / Designed by Tistory

티스토리툴바