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.mdSalin 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
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
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
useStatefor local UI state,useReducerfor complex state transitions with multiple sub-values - Apply
useEffectfor synchronizing with external systems (API calls, subscriptions, DOM measurements); always return a cleanup function - Memoize expensive computations with
useMemoand stable callback references withuseCallback, 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
forwardRefand expose imperative methods sparingly withuseImperativeHandle
Common Patterns
- Controlled Components: Manage form input values in state with
value={state}andonChange={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
keyprop 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.memobecause references change every render - Do not use
useEffectfor derived state; compute derived values during render or useuseMemoinstead 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
Komentar
- …
Skill lain dari repositori ini
browser-automation
18kMengajari agent Anda mengendalikan peramban web dengan Playwright, memakai selektor CSS untuk menemukan tombol, formulir, dan tautan.
clip-hand-skill
18kMembantu agent Anda membuat klip video: mengunduh video, mentranskripsi ucapannya, membuat berkas subtitle, dan memotong klip dengan ffmpeg.
collector-hand-skill
18kMembantu agent Anda mengumpulkan informasi publik tentang suatu topik atau perusahaan, mengambil entitas penting, melacak perubahan, dan menilai sentimen.
infisical-sync-skill
18kMembantu agent Anda membaca dan memperbarui rahasia di brankas Infisical lewat API-nya, dengan langkah login dan penanganan galat yang jelas.
Skill serupa
angular-developer
280kMembantu agent Anda membuat kode Angular dan memberi saran struktur proyek. Berguna saat memulai proyek baru, membuat komponen, atau meningkatkan performa.
frontend-a11y
280kMembantu agent Anda membuat antarmuka web dapat diakses semua orang. Memastikan website dan aplikasi berfungsi baik dengan screen reader dan navigasi keyboard.
frontend-patterns
280kMembuat agent Anda menerapkan pola modern dalam frontend. Mengoptimalkan performa, mengelola state, dan mengikuti praktik terbaik React dan Next.js.