Provides best practices and patterns for building robust, type-safe React applications with TypeScript.
Install
mkdir -p .claude/skills/react-dev-kscius && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/11302" && unzip -o skill.zip -d .claude/skills/react-dev-kscius && rm skill.zipInstalls to .claude/skills/react-dev-kscius
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
This skill should be used when building React components with TypeScript, typing hooks, handling events, or when React TypeScript, React 19, Server Components are mentioned. Covers type-safe patterns for React 18-19 including generic components, proper event typing, and routing integration (TanStack Router, React Router).Key capabilities
- →Type React components with TypeScript
- →Implement generic components
- →Type event handlers and hooks
- →Integrate React 19 features
- →Configure type-safe routing
How it works
It applies TypeScript patterns to React components, hooks, and events to ensure compile-time type safety.
Inputs & outputs
When to use react-dev
- →Build generic React components
- →Type complex event handlers
- →Migrate to React 19 patterns
About this skill
When to use
- This skill should be used when building React components with TypeScript, typing hooks, handling events, or when React TypeScript, React 19, Server Components are mentioned.
React TypeScript
On-demand loading: Read files from
references/andexamples/only when specific guidance is needed for the current step.
Type-safe React = compile-time guarantees = confident refactoring.
<when_to_use>
- Building typed React components
- Implementing generic components
- Typing event handlers, forms, refs
- Using React 19 features (Actions, Server Components, use())
- Router integration (TanStack Router, React Router)
- Custom hooks with proper typing
NOT for: non-React TypeScript, vanilla JS React
</when_to_use>
<react_19_changes>
Key breaking changes — see react-19-patterns.md for full migration checklist:
- ref as prop:
forwardRefdeprecated; passrefas a regular prop - useActionState: replaces
useFormStatefrom react-dom - use(): unwraps promises/context, triggers Suspense when unresolved
- useOptimistic: optimistic UI updates during async transitions
</react_19_changes>
<component_patterns>
Key typing patterns — see references for full examples:
- Props: extend native elements with
ComponentPropsWithoutRef<'button'> - Children: use
ReactNode(renderable),ReactElement(single element), render props for callbacks - Discriminated unions: model variant props with
| { variant: 'link'; href: string }
</component_patterns>
<event_handlers>
Use specific event types (not any) for accurate currentTarget typing:
- Mouse:
React.MouseEvent<HTMLButtonElement> - Form submit:
React.FormEvent<HTMLFormElement> - Input change:
React.ChangeEvent<HTMLInputElement> - Keyboard:
React.KeyboardEvent<HTMLInputElement>
See event-handlers.md for focus, drag, clipboard, touch, wheel events.
</event_handlers>
<hooks_typing>
Key patterns — see hooks.md for useCallback, useMemo, useImperativeHandle:
- useState: explicit type for unions/null —
useState<User | null>(null) - useRef:
nullinitial for DOM refs; non-null for mutable values - useReducer: discriminated union action types for exhaustive handling
- Custom hooks: return
[value, fn] as constfor correct tuple inference - useContext: null guard + throw pattern for required context consumers
</hooks_typing>
<generic_components>
Generic components infer types from props — no manual annotations at call site.
- Use
keyof Tfor column/field keys; render props for custom cell rendering - Constrain with
T extends HasIdwhen a required base shape is needed
See generic-components.md for Table, Select, List, Modal, FormField patterns.
</generic_components>
<server_components>
React 19 Server Components run on server, can be async — see server-components.md:
- Async RSC:
async function Page()fetches directly, no useEffect - Server Actions:
'use server'directive, callrevalidatePathafter mutations - Client + Action:
useActionState(serverAction, initialState)wires form to action - use() handoff: pass
Promisefrom server to client;use()suspends until resolved
</server_components>
<routing>Both TanStack Router and React Router v7 provide type-safe routing:
- TanStack Router: compile-time safety, Zod
validateSearch, file-based route tree - React Router v7: auto-generated
+types/from loaders/actions, Framework Mode
See tanstack-router.md and react-router.md.
</routing> <rules>ALWAYS:
- Specific event types (MouseEvent, ChangeEvent, etc)
- Explicit useState for unions/null
- ComponentPropsWithoutRef for native element extension
- Discriminated unions for variant props
- as const for tuple returns
- ref as prop in React 19 (no forwardRef)
- useActionState for form actions
- Type-safe routing patterns (see routing section)
NEVER:
- any for event handlers
- JSX.Element for children (use ReactNode)
- forwardRef in React 19+
- useFormState (deprecated)
- Forget null handling for DOM refs
- Mix Server/Client components in same file
- Await promises when passing to use()
- hooks.md - useState, useRef, useReducer, useContext, custom hooks
- event-handlers.md - all event types, generic handlers
- react-19-patterns.md - useActionState, use(), useOptimistic, migration
- generic-components.md - Table, Select, List, Modal patterns
- server-components.md - async components, Server Actions, streaming
- tanstack-router.md - TanStack Router typed routes, search params, navigation
- react-router.md - React Router v7 loaders, actions, type generation, forms
When not to use it
- →When working with vanilla JavaScript React projects
Prerequisites
Limitations
- →Requires TypeScript knowledge
- →Strictly for React TypeScript projects
How it compares
It enforces strict typing patterns that prevent runtime errors, unlike standard React development.
Compared to similar skills
react-dev side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| react-dev (this skill) | 0 | 2mo | No flags | Intermediate |
| zustand | 113 | 2mo | No flags | Intermediate |
| web-artifacts-builder | 49 | 3mo | Review | Intermediate |
| landing-page-guide-v2 | 48 | 8mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
zustand
lobehub
Zustand state management guide. Use when working with store code (src/store/**), implementing actions, managing state, or creating slices. Triggers on Zustand store development, state management questions, or action implementation.
web-artifacts-builder
anthropics
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.
landing-page-guide-v2
bear2u
Create distinctive, high-converting landing pages that combine proven conversion elements with exceptional design quality. Build beautiful, memorable landing pages using Next.js 14+ and ShadCN UI that avoid generic AI aesthetics while following the 11 essential elements framework.
react
lobehub
React component development guide. Use when working with React components (.tsx files), creating UI, using @lobehub/ui components, implementing routing, or building frontend features. Triggers on React component creation, modification, layout implementation, or navigation tasks.
frontend-prompt-generator
gharam1234
Generate structured prompts for frontend development tasks following established patterns. Use when the user requests prompts for wireframes, UI implementation, data binding, or routing functionality in React/Next.js projects with specific formatting requirements (Cursor rules, file paths, test-driven development).
react-dev
davila7
This skill should be used when building React components with TypeScript, typing hooks, handling events, or when React TypeScript, React 19, Server Components are mentioned. Covers type-safe patterns for React 18-19 including generic components, proper event typing, and routing integration (TanStack Router, React Router).