toolmark-monorepo / @toolmark/inertia / InertiaFormLike
Interface: InertiaFormLike<V>
Defined in: packages/inertia/src/inertia-adapter.ts:9
The subset of @inertiajs/react's useForm() return value inertiaAdapter needs, structurally compatible with both Inertia 2 and 3 (InertiaFormProps<V> / InertiaForm<V>).
Type Parameters
V
V extends Record<string, unknown>
Properties
data
data:
V
Defined in: packages/inertia/src/inertia-adapter.ts:11
The form's current values, as of the last render.
errors
errors:
Partial<Record<string,string>>
Defined in: packages/inertia/src/inertia-adapter.ts:15
Server-reported validation errors, keyed by field.
Methods
setData()
setData(
data):void
Defined in: packages/inertia/src/inertia-adapter.ts:13
Replaces the form's values (Inertia's setData, called with a full object).
Parameters
data
V
Returns
void
submit()
submit(
method,url,opts):void
Defined in: packages/inertia/src/inertia-adapter.ts:19
Starts a visit (Inertia's useForm().submit).
Parameters
method
string
url
string
opts
Returns
void
transform()
transform(
callback):void
Defined in: packages/inertia/src/inertia-adapter.ts:17
Registers a callback that produces the payload a visit actually sends.
Parameters
callback
(data) => Record<string, unknown>
Returns
void