Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Forge React Components?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ansh44233-forge-react-components)
---
name: forge-react-components
description: "Write React components and hooks: state placement, effects, performance, forms and testing with Testing Library"
---
<!-- Generated from catalog/skills/react-components/SKILL.md by scripts/build-plugin.ts. Edit the catalog, not this file. -->
# React components
Use when building or fixing React UI (web or React Native).
## State and effects
- Keep state as low as possible and derive the rest during render. Do not mirror props into state.
- `useEffect` is for synchronizing with external systems (subscriptions, network, DOM APIs), not for computing values. Most "effect to update state" code should be a calculation or an event handler.
- Every effect that subscribes or starts work needs cleanup. Include all dependencies; do not silence `react-hooks/exhaustive-deps`.
- Server data belongs in a data library (TanStack Query, SWR, framework loaders), not hand-rolled `useEffect` fetches with race conditions.
## Rendering
- Stable, unique `key`s from data ids, never array indexes for lists that change order.
- Memoize (`useMemo`, `useCallback`, `memo`) only when a profiler shows a real cost or a child depends on referential equality.
- Split large components by responsibility; colocate styles and tests.
## Forms and accessibility
- Every input has a label; errors are announced (`aria-describedby`, `aria-invalid`).
- Buttons are `<button>` elements, links are `<a>`; never clickable `div`s.
- Disable double submits and show pending state.
## Testing
React Testing Library: query by role and accessible name (`getByRole("button", { name: /save/i })`), drive with `userEvent`, and assert on what the user sees, not on implementation details.
## Verify
Typecheck, lint (including the hooks rules), component tests, then check the browser console for warnings while using the changed screen.