dev-proPRO
OverviewLộ Trình HọcPhỏng VấnAI System
dev-pro— Thực chiến Frontend React, Next.js & Luyện phỏng vấn
contact@dev-pro.online•Code thật. Phỏng vấn thật.
Seri React Mastery8 Lộ trình · Sandbox
Seri React Mastery
8 tracks
T01
React Core Foundations0/7 hoàn thành
T02
React Hooks Mastery0/5 hoàn thành
T03
React Component Architecture & Forms0/4 hoàn thành
  • Bài học (4)
  • Quy chuẩn Viết Custom Component & Typescript (Enterprise)15m•intermediate
  • Chuyên sâu Form: Controlled vs Uncontrolled Components18m•intermediate
  • Tối ưu Memoization thủ công: useMemo & useCallback15m•intermediate
  • Khoanh vùng lỗi với React Error Boundary & Next.js error.tsx18m•advanced
T04
React & Compiler: Modern Path0/4 hoàn thành
T05
Form Engineering: RHF + Zod + Server Actions0/2 hoàn thành
T06
Advanced React Performance Patterns0/4 hoàn thành
T07
Enterprise React Testing & Production Readiness0/5 hoàn thành
T08
Production Capstone: TeamBoard0/1 hoàn thành
Tiến độ React0/32 bài
React Component Architecture & Forms
intermediate
15 phút
#TypeScript
#Component Design
#Best Practices

Quy chuẩn Viết Custom Component & Typescript (Enterprise)

Hướng dẫn đặt tên Component/Files và quy tắc khi nào chọn `type` vs `interface` cho Props.

Core Mental Model

Thiết kế Component chuẩn: Tên thể hiện đúng trách nhiệm, Props rõ ràng mã hóa Type/Interface và hỗ trợ mở rộng.

Key Takeaways & Principles

Đặt tên Component: Dùng tên ngắn gọn trực diện như `Button` (trong `src/components/ui/button.tsx`), KHÔNG dùng tiền tố `Custom` thừa thãi.
Dùng `interface` khi: Định nghĩa Object shapes cần mở rộng (extends) hoặc Declaration Merging (Component Props cho UI Library).
Dùng `type` khi: Định nghĩa Union types ("sm" | "md" | "lg"), Discriminated Unions (Status = Success | Error), Tuples, Primitives hoặc Mapped types.