next-safe-actionplayground
Overview
  • Home
Core
  • Core Actions
  • Validation Errors
  • Middleware
Hooks
  • React Hooks
  • Optimistic Updates
Forms
  • Form Integration
  • React Hook Form
Framework
  • Navigation & Framework
  • GitHub

React Hook Form

All three adapter hooks from @next-safe-action/adapter-react-hook-form.

useHookFormAction
Full integration: zodResolver, handleSubmitWithAction, resetFormAndAction, server validation error mapping.
Status:Idle
Result:
{}
useHookFormOptimisticAction
Optimistic form with currentState/updateFn — items appear instantly before server confirms.

No items yet.

Status:Idle
Optimistic state:
{
  "items": []
}
useHookFormActionErrorMapper
Advanced pattern: separate useAction + useForm with the error mapper hook for custom control.
Status:Idle
Result:
{}