Pinned Loading
-
Type Safe Server Action Hook
Type Safe Server Action Hook 1import { useState, useCallback } from "react";
23import { ActionState, FormFieldErrors } from "@/lib/create-safe-action";
45type Action<TInput, TOutput> = (data: TInput) => Promise<ActionState<TInput, TOutput>>;
-
Server Action Wrapper with Validation
Server Action Wrapper with Validation 1import { z } from "zod";
23export type FormFieldErrors<T> = {
4[Key in keyof T]?: string[];
5}
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.
