#useFormState

1 messages · Page 1 of 1 (latest)

stone hornet
#

const initialState = {
type: "success",
message: "",
id: data.id,
};

const [state, formAction] = useFormState(DeleteSubTodoAction, initialState);

No overload matches this call.
Overload 1 of 2, '(action: (state: void) => void | Promise<void>, initialState: void, permalink?: string | undefined): [state: void, dispatch: () => void, isPending: boolean]', gave the following error.
Argument of type '(prevState: any, formData: FormData) => Promise<void>' is not assignable to parameter of type '(state: void) => void | Promise<void>'.
Target signature provides too few arguments. Expected 2 or more, but got 1.
Overload 2 of 2, '(action: (state: void, payload: FormData) => void | Promise<void>, initialState: void, permalink?: string | undefined): [state: void, dispatch: (payload: FormData) => void, isPending: boolean]', gave the following error.
Argument of type '{ type: string; message: string; id: number; }' is not assignable to parameter of type 'void'.

tidal trailBOT
#

Hi @stone hornet. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: