What problem does it solve?
This skill prevents React + TypeScript code from becoming fragile by standardizing type-safe patterns for components, event handlers, hooks, and route integration—especially during React 19 migrations.
Core Features & Use Cases
- Type-safe React component patterns: extend native element props via
React.ComponentPropsWithoutRef, strongly type children and render props, and use discriminated unions for variant behavior.
- Correct event + form typing: apply precise
React.*Event<...> types for mouse, keyboard, focus, drag-and-drop, clipboard, touch, and wheel handlers, plus typed form submission with FormData.
- React 19 + Server Components readiness: cover
ref as prop (no forwardRef), useActionState, and use() promise/context unwrapping along with Server Actions/client boundaries.
- Routing type-safety integration: align component typing with TanStack Router (validated
validateSearch, typed loader output) and React Router v7 (typed loader/action data via generated types).
- Hook typing discipline: handle unions/null explicitly in
useState, distinguish DOM refs vs mutable value refs in useRef, and type custom hooks with stable tuple/object returns.
Quick Start
Use the react-dev skill when generating a React 19 + TypeScript component that includes typed events and integrates with TanStack Router or React Router v7.