mirror of
https://github.com/LukeHagar/form.git
synced 2025-12-06 04:19:43 +00:00
* chore: initial work at scaffolding Vue package * chore: initial work on adding in useField and useForm API * chore: fix build for Vue package * chore: migrate to slots for functional comps * chore: got initial fields rendering * chore: add component names for debuggability * chore: fix error regarding passdown props * chore: fix Promise constructor error in demo * chore: initial work at writing vue store implementation * feat: add initial useStore and Subscribe instances * fix: state is now passed as a dedicated reactive option * chore: temporarily remove Vue 2 typechecking * chore: make Provider and selector optional * chore: add createFormFactory * chore: attempt 1 of test - JSX * chore: attempt 2 of test - Vue JSX * chore: attempt 3 of test - H * chore: migrate to proper h function * chore: fix tests by bumping package * chore: fix JSX typings * chore: add another test for useForm * chore: listen for fieldAPIs to update * fix: fields should now update during mount * chore: add test for useField in Vue * test: add useField Vue tests * docs: add early docs for Vue package
986 B
986 B
id, title
| id | title |
|---|---|
| createFormFactory | createFormFactory |
createFormFactory
export function createFormFactory<TFormData>(
opts?: FormOptions<TFormData>,
): FormFactory<TFormData>
A function that creates a new FormFactory<TFormData> instance.
opts- Optional form options and a
listenfunction to be called with the form state.
- Optional form options and a
FormFactory<TFormData>
A type representing a form factory. Form factories provide a type-safe way to interact with the form API as opposed to using the globally exported form utilities.
export type FormFactory<TFormData> = {
useForm: (opts?: FormOptions<TFormData>) => FormApi<TFormData>
useField: UseField<TFormData>
Field: FieldComponent<TFormData>
}
useForm- A custom composition that creates and returns a new instance of the
FormApi<TFormData>class.
- A custom composition that creates and returns a new instance of the
useField- A custom composition that returns an instance of the
FieldApi<TFormData>class.
- A custom composition that returns an instance of the
Field- A form field component.