full-stack-skills/react-skills

react-hooks

Provides comprehensive guidance for React Hooks including useState, useEffect, useContext, useReducer, useMemo, useCallback, custom hooks, and hook patterns.

View source

How to use

  1. Copy the installation command and review the source package before installing it in your own agent environment.
  2. Check the source document for required tools, credentials and supported hosts.
  3. Describe your input and desired deliverable; review the output against the source material.
npx skills add https://github.com/full-stack-skills/react-skills --skill react-hooks

Before you start

  • Installation does not include a model subscription, API allowance or permission to access your files.
  • Repository stars and installation counts describe activity, not an independent quality or security test.
Original skill document

Rendered from the source repository. Headings, examples, code, tables, links, and referenced images are preserved.

When to use this skill

Use this skill whenever the user wants to:

  • 用 React Hooks(useState、useEffect、useContext、自定义)管理状态与副作用
  • 遵循 Hooks 规则与最佳实践、避免闭包与依赖问题

How to use this skill

  1. 基础:useState、useEffect(依赖数组、清理函数);useContext、useRef。
  2. 进阶:useMemo、useCallback、自定义 Hook;useReducer、useLayoutEffect。
  3. 参考:https://react.dev/reference/react

Best Practices

  • 依赖数组完整;清理订阅与定时器。
  • 自定义 Hook 命名 useXxx;避免条件/循环中调 Hook。

Keywords

React Hooks, useState, useEffect, 自定义 Hook

Related by task

from this repository

More skills

All skills