Conditionally applies a predefined schema to a given FieldPath.
API
function applyWhen<TValue>(
path: FieldPath<TValue>,
logic: LogicFn<TValue, boolean>,
schema: NoInfer<SchemaOrSchemaFn<TValue>>,
): void;applyWhen
voidConditionally applies a predefined schema to a given FieldPath.
@paramlogic
LogicFn<TValue, boolean>A LogicFn<T, boolean> that returns true when the schema should be applied.
@paramschema
NoInfer<SchemaOrSchemaFn<TValue>>The schema to apply to the field when the logic function returns true.
@returns
voidJump to details