New advertisers: 50% off your first month with code FIRSTMONTHSee slots

Type-safe React 18-19 patterns covering generic components, event typing, hooks, and router integration.

skills.sh installs
4.2K
GitHub stars
2.7K
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers typed components, React 19 APIs (Actions, use(), Server Components), hooks, event handlers, and routing
  • Includes migration notes for React 19 such as ref as a prop, useActionState, and use() unwrapping promises
  • Provides generic component patterns using keyof T columns and constrained T extends HasId types
  • Designed for projects using TypeScript with React, TanStack Router, or React Router, not vanilla JavaScript React

Install

$ npx -y skills add softaworks/agent-toolkit --skill react-dev -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

React TypeScript

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>

React 19 breaking changes require migration. Key patterns:

ref as prop - forwardRef deprecated:

// React 19 - ref as regular prop
type ButtonProps = {
  ref?: React.Ref<HTMLButtonElement>;
} & React.ComponentPropsWithoutRef<'button'>;

function Button({ ref, children, ...props }: ButtonProps) {
  return <button ref={ref} {...props}>{children}</button>;
}

useActionState - replaces useFormState:

import { useActionState } from 'react';

type FormState = { errors?: string[]; success?: boolean };

function Form() {
  const [state, formAction, isPending] = useActionState(submitAction, {});
  return <form action={formAction}>...</form>;
}

use() - unwraps promises/context:

Details

Repository
github.com/softaworks/agent-toolkit
Categories
Frontend & UI Code, Skill & Plugin Building

More from softaworks/agent-toolkit

All 40

Similar to React Dev

More Frontend & UI Code