react-dev

Apply type-safe React patterns for components, events, Server Components, Actions, and TanStack Router.

28|1|Updated Aug 30, 2025
One-click install
npx skills add https://github.com/outfitter-dev/agents --skill react-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-dev
Source: https://github.com/outfitter-dev/agents/tree/main/baselayer/skills/react-dev
Command: npx skills add https://github.com/outfitter-dev/agents --skill react-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill presents type-safe React patterns for TS users, including generic components, event typing, Server Components, Actions, and TanStack Router integration.

Core Features & Use Cases

  • Typed components and props: Robust type-safe components.
  • Event typing: Strong typings for mouse, keyboard, and form events.
  • Server Components & Actions: Server/client boundaries with server actions.
  • TanStack Router integration: End-to-end type-safe routing.

Quick Start

Apply type-safe patterns to new React components, add Server Components where needed, and wire up TanStack Router with typed routes.

Frequently Asked Questions about react-dev

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build type-safe React components with TypeScript?

Type-safe React components use TypeScript generics and strict prop typing to catch errors at compile time. Define generic component signatures with constrained type parameters, apply event handler typing for mouse, keyboard, and form events, and leverage React 18-19 features like Server Components for end-to-end type safety across your application.

What's the best way to handle Server Components and Server Actions in React?

Server Components and Server Actions let you execute logic on the server while maintaining type safety through TypeScript. Define server functions with clear boundaries, use Server Actions to handle mutations, and integrate them with client components to reduce bundle size and improve data fetching security.

Can I use TanStack Router with TypeScript for type-safe routing?

TanStack Router provides end-to-end type-safe routing with full TypeScript support. Define typed routes with route parameters, loaders, and actions, then access route data and navigation with complete type inference, eliminating runtime routing errors and improving developer experience.

Do I need Server Components to use type-safe patterns in React?

Server Components are optional but recommended for type-safe patterns. Generic components, event typing, and proper TypeScript configuration work independently. Server Components enhance type safety at server-client boundaries and enable Server Actions, but typed components and TanStack Router integration work with traditional client-side React.

How do I properly type form events and keyboard events in React with TypeScript?

Form and keyboard events require specific TypeScript event types like FormEvent, KeyboardEvent, and MouseEvent with proper generic parameters. Annotate event handlers with these types, use event.currentTarget for type-narrowed access to form elements, and leverage TypeScript's strict mode to catch type mismatches.

What's the difference between typed generic components and standard React components?

Generic components accept type parameters that consumers define, enabling reusable patterns across different data types while preserving full type safety. This approach eliminates prop casting, improves IntelliSense suggestions, and makes component contracts explicit—compared to standard components which rely on any or union types.