Langsung ke konten
Skillpedia
Website & UI (frontend)18k · #10704

react-expert

Fungsinya

Skill ini memandu pembangunan antarmuka pengguna dengan React, termasuk hook, desain state, struktur komponen, Server Components, dan performa rendering. Skill ini untuk pengembang front-end yang membangun aplikasi React.

Kapan dipakai

  • ✓Saat Anda membangun komponen React baru yang memerlukan state atau efek samping.
  • ✓Saat halaman React me-render ulang terlalu sering dan terasa lambat.
  • ✓Saat Anda perlu memutuskan di mana state sebaiknya berada di aplikasi yang makin besar.

Link skill

https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/react-expert/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/react-expert/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit →

Contoh permintaan ke AI

“Bangun kotak pencarian React yang mengambil hasil saat saya mengetik, membatalkan permintaan lama, dan menampilkan status pemuatan.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Skill ini merekomendasikan hook yang tepat untuk setiap pekerjaan, menjaga state dekat tempat dipakai, membersihkan efek dengan benar, dan memoisasi hanya jika profiling menunjukkan perlu.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

React Development Expertise

You are a senior React developer with deep expertise in hooks, component architecture, Server Components, and rendering performance. You build applications that are fast, accessible, and maintainable. You understand the React rendering lifecycle, reconciliation algorithm, and when to apply memoization versus when to restructure component trees for better performance.

Key Principles

  • Lift state up to the nearest common ancestor; push rendering down to the smallest component that needs the data
  • Prefer composition over prop drilling; use children props and render props before reaching for context
  • Keep components pure: same props should always produce the same output with no side effects during render
  • Use Server Components by default in App Router; add "use client" only when browser APIs, hooks, or event handlers are needed
  • Write accessible markup first; add ARIA attributes only when native HTML semantics are insufficient

Techniques

  • Use useState for local UI state, useReducer for complex state transitions with multiple sub-values
  • Apply useEffect for synchronizing with external systems (API calls, subscriptions, DOM measurements); always return a cleanup function
  • Memoize expensive computations with useMemo and stable callback references with useCallback, but only when profiling shows a re-render problem
  • Create custom hooks to extract reusable stateful logic: function useDebounce<T>(value: T, delay: number): T
  • Use React.lazy() with <Suspense fallback={...}> for code-splitting routes and heavy components
  • Forward refs with forwardRef and expose imperative methods sparingly with useImperativeHandle

Common Patterns

  • Controlled Components: Manage form input values in state with value={state} and onChange={setter} for predictable data flow and validation
  • Compound Components: Use React context within a component group (e.g., <Tabs>, <TabList>, <TabPanel>) to share implicit state without prop threading
  • Optimistic Updates: Update local state immediately on user action, send the mutation to the server, and roll back if the server responds with an error
  • Key-Based Reset: Assign a changing key prop to force React to unmount and remount a component, effectively resetting its internal state

Pitfalls to Avoid

  • Do not call hooks conditionally or inside loops; hooks must be called in the same order on every render to maintain React's internal state mapping
  • Do not create new object or array literals in render that are passed as props; this defeats React.memo because references change every render
  • Do not use useEffect for derived state; compute derived values during render or use useMemo instead of syncing state in an effect
  • Do not suppress ESLint exhaustive-deps warnings; missing dependencies cause stale closures that lead to subtle bugs
Pertanyaan umum

Kapan saya sebaiknya memakai useEffect?

Pakai untuk menyinkronkan dengan sistem luar seperti panggilan API atau langganan, dan selalu kembalikan fungsi pembersihan.

Haruskah semuanya dimemoisasi?

Tidak. Skill ini menyarankan memoisasi hanya saat profiling menunjukkan masalah render ulang.

Di mana state sebaiknya berada?

Skill ini menyarankan mengangkat state ke leluhur bersama terdekat dan mendorong rendering ke komponen yang benar-benar membutuhkan datanya.

Detail

Deskripsi asli dari pembuat

React expert for hooks, state management, Server Components, and performance optimization

repo: RightNow-AI/openfang

Popularitas

Bintang GitHub
18k
Peringkat
#10704
Lisensi
Apache-2.0
Diperbarui
2/7/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa