跳到正文
cccskills
免费在 GitHub 公开

react-expert

Build and improve React interfaces with guidance on component structure, hooks, state management, and Server Components. Review unnecessary rendering, extract reusable logic, and implement accessible forms and loading states using established React patterns.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

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

查看安装方法

适用场景

  • Reviewing component structure and shared state
  • Investigating unnecessary rendering
  • Extracting reusable custom hooks
  • Separating Server Components from client interactions

包含的文件(1)

  • SKILL.md3.0 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

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

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

ansible

免费

Create Ansible automation for configuring and updating servers. Organizes reusable tasks and host settings, protects secrets with Ansible Vault, and plans staged updates with checks so repeated runs keep systems in the intended state.

中文简介正在准备中。当前显示英语简介。

  • Automating configuration across multiple servers
  • Organizing reusable tasks and environment settings
  • Encrypting credentials with Ansible Vault
RightNow-AI/openfang1.8万2026年7月2日 更新

Test and debug REST and GraphQL APIs using curl, httpie, Postman collections, or scripted tests. Check authentication, invalid inputs, pagination, and response details to identify failures that a successful status code alone may miss.

中文简介正在准备中。当前显示英语简介。

  • Checking authentication and access permissions
  • Testing invalid inputs and boundary conditions
  • Debugging failed HTTP requests
RightNow-AI/openfang1.8万2026年7月2日 更新

aws

免费

Plan, deploy, and manage AWS infrastructure across computing, storage, networking, and serverless services. Get guidance on access permissions, backups, auditing, and cost management using AWS CLI and tools that define infrastructure in code.

中文简介正在准备中。当前显示英语简介。

  • Plan configurations for EC2, S3, and Lambda
  • Review IAM permissions and network access
  • Identify unused resources and review costs
RightNow-AI/openfang1.8万2026年7月2日 更新

azure

免费

Helps design and provision Microsoft Azure infrastructure using az CLI and Bicep configuration files. Covers choosing application hosting services, managing identities and secrets, designing networks, setting up monitoring, and organizing resources for cost management.

中文简介正在准备中。当前显示英语简介。

  • Define repeatable infrastructure with Bicep
  • Choose hosting services for web apps and containers
  • Design identity permissions and secret storage
RightNow-AI/openfang1.8万2026年7月2日 更新

Automate website searches, logins, form entry, and price comparisons using Playwright, a browser automation tool. Provides workflows for locating page elements, checking results, and recovering from navigation errors or missing elements.

中文简介正在准备中。当前显示英语简介。

  • Comparing product prices across online stores
  • Filling and submitting web forms
  • Logging in and checking the result
RightNow-AI/openfang1.8万2026年7月2日 更新

ci-cd

免费

Design automated build, test, and deployment workflows for GitHub Actions, GitLab CI/CD, and Jenkins. Covers job ordering, dependency caching, secret handling, and gradual releases that use health checks before expanding deployment.

中文简介正在准备中。当前显示英语简介。

  • Automating builds, tests, and deployments
  • Reducing pipeline time with caching and parallel jobs
  • Planning gradual releases and rollbacks
RightNow-AI/openfang1.8万2026年7月2日 更新

查看 RightNow-AI 的全部技能

报告此技能的问题