주요 변경사항
- 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을 수동으로 작성할 필요가 없어집니다.
댓글 0