useFormState initialValue overload error
Answered
Arinji posted this in #help-forum
ArinjiOP
const initialState = {
type: "success",
message: "",
id: data.id,
};
const [state, formAction] = useFormState(DeleteSubTodoAction, initialState);Argument of type '{ type: string; message: string; id: number; }' is not assignable to parameter of type 'void
Why would initial state be void :/
1 Reply
ArinjiOP
oh my action has to return state.....
Answer