react-19
React 19.3+ patterns. Use for forms, async data, pre-rendering, transitions, refs, context, metadata.
Installation
Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.
View source ↗GuidesSkill instructions
React 19.3+
Avoid → Use
-
useState+onChangefor forms →useActionState→examples/form-action.tsx -
awaitin server components → pass promise,use()in client →examples/use-server-promise.tsx -
forwardRef→refas prop -
useCallback/useMemo→ compiler handles it -
useContext→use(Context) -
Context.Provider→<Context value={}> - Manual state reset on prop change →
keyprop
Patterns
-
Forms:
useActionState(fn, init)+useOptimistic+useFormStatus→examples/form-action.tsx -
Pre-rendering:
<Activity mode="hidden">→examples/activity-prerender.tsx -
Effect events:
useEffectEvent()for non-reactive logic in effects →examples/effect-event.tsx -
Async data: pass promise from server, unwrap with
use()→examples/use-server-promise.tsx -
ViewTransition: wrap elements, use
startTransition()+addTransitionType()→examples/view-transition.tsx -
Mutations outside forms:
useTransition+ Server Action →examples/server-action-mutation.tsx -
Suspense:
<Suspense fallback={...}>wraps async components -
Deferred value:
useDeferredValue(value, initialValue) -
Request memoization:
cache(async fn)withcacheSignal() -
Server Action:
"use server"+revalidatePath()/revalidateTag() -
Metadata:
<title>,<meta>,<link>hoisted to<head> -
Refs:
refas prop, cleanup via return function
Component structure
- One component per file
- Inner functions use arrow syntax:
const handleX = () => {}
Examples
Read the usage examples in the source repository.
View source ↗Source history
- Indexed on
- 2026-01-20
- Index updated
- 2026-03-03
- Branch
- main
Index and sync dates describe this directory. View the source repository for code history.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!