OtherwiseWithReason
ref / conversations / OtherwiseWithReason
A callback function to be invoked after a context object failed form validation.
A form action receives the rejected context object as the first argument.
If validation fails and a reason is specified as an error of the Result return value of the validation function, the form action receives the error as a second argument. If no reason was specified, use Otherwise instead.
Type Parameters
C
ts
C extends Context
R
ts
R
Type
ts
(ctx: C, reason: R) => unknown | Promise<unknown>