Skip to main content
Version: 0.1.2

Function: formGroup()

Imported from @react-logic/utils

formGroup<S>(schema): FormGroup<S>

Mark an object literal as a nested group inside a form schema. Plain objects without this marker are treated as field configs.

Type Parameters

S

S extends Schema

Parameters

schema

S

Returns

FormGroup<S>

Example

formState({
name: {},
email: {},
address: formGroup({
street: {},
city: {},
zip: {},
}),
});