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.

Quelltext ansehen

Verwendung

  1. Installationsbefehl kopieren und das Quellpaket vor der Installation in der eigenen Agentenumgebung prüfen.
  2. Benötigte Werkzeuge, Zugangsdaten und Hosts im Original prüfen.
  3. Eingabe und gewünschtes Ergebnis beschreiben und die Ausgabe mit den Quellen abgleichen.
npx skills add https://github.com/full-stack-skills/react-skills --skill react-hooks

Vor dem Start

  • Die Installation umfasst weder Modellabo noch API-Kontingent oder Dateizugriffsrechte.
  • Sterne und Installationen zeigen Aktivität, keine unabhängige Qualitäts- oder Sicherheitsprüfung.
Originales Skill-Dokument

Aus dem Quell-Repository gerendert; Überschriften, Beispiele, Code, Tabellen, Links und Bilder bleiben erhalten.

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

Verwandte Aufgaben

aus demselben Repository

Weitere Skills

Alle Skills
full-stack-skills
Community

nextjs

Guidance for Next.js using the official docs at nextjs.org/docs. Use when the user needs Next.js concepts, configuration, routing, data fetching, or API reference details.

Installationen
2
GitHub Stars
2
Aktualisiert
3. Okt.
full-stack-skills
Community

react

Provides comprehensive guidance for React development including components, JSX, props, state, hooks, context, performance optimization, and best practices. Use when the user asks about React, needs to create React components, implement hooks, manage component state, or build React applications.

Installationen
2
GitHub Stars
2
Aktualisiert
3. Okt.
full-stack-skills
Community

redux

Provides comprehensive guidance for Redux state management including stores, actions, reducers, middleware, selectors, and Redux Toolkit. Use when the user asks about Redux, needs to manage global state, implement Redux patterns, or work with Redux middleware.

Installationen
2
GitHub Stars
2
Aktualisiert
3. Okt.
full-stack-skills
Community

react-native

Provides comprehensive guidance for React Native development including components, navigation, native modules, platform-specific code, and mobile app development. Use when the user asks about React Native, needs to create mobile applications, implement React Native components, or work with React Native features.

Installationen
1
GitHub Stars
2
Aktualisiert
3. Okt.