react-frontend

Solid

React architecture patterns, TypeScript, Next.js, hooks, and testing. Use when working with React component structure, state management, Next.js routing, Vitest, React Testing Library, or reviewing React code. For visual design and aesthetic direction, use frontend-design instead.

Web & Frontend 39 stars 8 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 86/100

Stars 20%
53
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# React Frontend **Verify before implementing**: For App Router patterns, React 19 APIs, or version-specific behavior, look up current docs (Context7 `query-docs` if available, else the framework's official docs via web search) before writing code. Training data may lag current releases. ## Component TypeScript - Extend native elements with `ComponentPropsWithoutRef<'button'>`, add custom props via intersection - Use `React.ReactNode` for children, `React.ReactElement` for single element, render prop `(data: T) => ReactNode` - Discriminated unions for variant props -- TypeScript narrows automatically in branches - Generic components: `<T>` with `keyof T` for column keys, `T extends { id: string }` for constraints - Event types: `React.MouseEvent<HTMLButtonElement>`, `FormEvent<HTMLFormElement>`, `ChangeEvent<HTMLInputElement>` - `as const` for custom hook tuple returns - `useRef<HTMLInputElement>(null)` for DOM (use `?.`), `useRef<number>(0)` for mutable values - Explicit `useState<User | null>(null)` for unions/null - useReducer actions as discriminated unions: `{ type: 'set'; payload: number } | { type: 'reset' }` - useContext null guard: throw in custom `useX()` hook if context is null ## Effects Decision Tree Effects are escape hatches -- most logic should NOT use effects. | Need | Solution | |------|----------| | Derived value from props/state | Calculate during render (useMemo if expensive) | | Reset state on prop change | `key` prop on component | | Respond to us...

Details

Author
iliaal
Repository
iliaal/ai-skills
Created
6 months ago
Last Updated
1 weeks ago
Language
Shell
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category