본문 바로가기

한우의 개발일기

검색하기
한우의 개발일기
프로필사진 한우코딩

  • 개발일기 (24)
    • 타입스크립트 (0)
    • React (13)
    • NextJS (8)
    • 기타 (0)
    • 자바스크립트 (2)
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
  • CSR
  • next-cookies
  • 리액트 훅
  • react-hook-form
  • SSR
  • msw
  • Database
  • 리액트
  • useLayoutEffect
  • Firebase
  • 리액트훅
  • 초기마운트
  • reactquery
  • key
  • NextJs
  • useEffect
  • express
  • ErrorBoundary
  • docker
  • react
  • lazy()
  • react-hook
  • 클래스
  • 모던자바스크립트
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록리액트훅 (1)

한우의 개발일기

useAsync 파해치기

useRef 파해치기 와 이어집니다useAsync 훅 확인하기useAsync 훅 분석import { useEffect, useRef, useState } from 'react'export function useAsync( func: () => Promise | undefined | null, deps = [],) { const ref = useRef(func) ref.current = func const [value, setValue] = useState() useEffect(() => { ref.current()?.then(setValue) // eslint-disable-next-line react-hooks/exhaustive-deps }, deps) return value..

React 2025. 3. 18. 16:53
이전 Prev 1 Next 다음

Blog is powered by kakao / Designed by Tistory

티스토리툴바