If you're writing React with TypeScript and tired of wrestling with event types or generic component patterns, this gives you the current playbook for React 18 and 19. It covers the breaking changes like ref as prop and useActionState, shows you how to type discriminated union props correctly, and handles the gnarly stuff like generic tables with keyof constraints. The router integration examples are solid for both TanStack and React Router. Most useful when you know React but want compile-time safety without constantly fighting the type system or reaching for any.

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

Install

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

Installs into .claude/skills of the current project.

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:

Sponsors

Details

Repository
github.com/softaworks/agent-toolkit
Categories
Frontend Development, Backend & APIs, AI & Agent Building

More from softaworks/agent-toolkit

All 43
1freshtechbro avatarreact-three-fiberfreshtechbro/claudedesignskillsBuild declarative 3D scenes with React Three Fiber (R3F) - a React renderer for Three.js. Use when building interactive 3D experiences in React applications wit4.1Kskills.sh installs
2giuseppe-trisciuoglio avatarnextjs-code-reviewgiuseppe-trisciuoglio/developer-kitProvides comprehensive code review capability for Next.js applications, validates Server Components, Client Components, Server Actions, caching strategies, meta3.9Kskills.sh installs
3getsentry avatarsentry-nextjs-sdkgetsentry/sentry-for-aiFull Sentry SDK setup for Next.js. Use when asked to "add Sentry to Next.js", "install @sentry/nextjs", or configure error monitoring, tracing, session replay, 3.7Kskills.sh installs
4getsentry avatarsentry-react-sdkgetsentry/sentry-for-aiFull Sentry SDK setup for React. Use when asked to "add Sentry to React", "install @sentry/react", or configure error monitoring, tracing, session replay, profi3.2Kskills.sh installs
5nexu-io avatarfrontend-slidesnexu-io/open-designGenerate animation-rich HTML presentations with visual style previews. Useful for online keynotes, embedded talks, and interactive briefs.3Kskills.sh installs
6nexu-io avatargsap-reactnexu-io/open-designOfficial GSAP skill for React — useGSAP hook, refs, gsap.context(), cleanup. Use when the user wants animation in React or Next.js, or asks about GSAP with Reac2.9Kskills.sh installs