Frontend2025년 1월 5일1분 읽기

React 19 공식 릴리스 — 마이그레이션 완벽 가이드

YS
YoungSam
조회 469

주요 변경사항

  • use() 훅 정식 지원
  • React Compiler (자동 메모이제이션)
  • forwardRef 불필요 (ref를 props로 전달)
  • Context.Provider → Context 직접 사용

마이그레이션

// Before (React 18)
const MyInput = forwardRef((props, ref) => {
  return <input ref={ref} {...props} />;
});

// After (React 19)
function MyInput({ ref, ...props }) {
  return <input ref={ref} {...props} />;
}

React Compiler

useMemo, useCallback을 수동으로 작성할 필요가 없어집니다.

ReactReact 19Migration

댓글 0

아직 댓글이 없습니다.