Skip to main content

react-hooks

Provides comprehensive guidance for React Hooks including useState, useEffect, useContext, useReducer, useMemo, useCallback, custom hooks, and hook patterns. Use when the user asks about React Hooks, needs to use hooks in functional components, create custom hooks, or optimize hook performance.

来源信息

仓库
full-stack-skills/react-skills
最近来源活动
2026年9月15日 09:47
检测到的 SKILL.md 语言
多语言混合
星标
1
分支
1

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

文件资源管理器
2 个文件

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
react-hooks
description
Provides comprehensive guidance for React Hooks including useState, useEffect, useContext, useReducer, useMemo, useCallback, custom hooks, and hook patterns. Use when the user asks about React Hooks, needs to use hooks in functional components, create custom hooks, or optimize hook performance.
license
Apache-2.0
## 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
在 GitHub 查看