Skip to content

Consider moving useField, useFieldError, and useFormStatus, hook logic to form inteface #92

@10xjs

Description

@10xjs

Idea: Preserve the existing hooks, but move the internal logic to useForm.

This would allow exposing form.getStatus(), form.getField() etc on the context itself. Each hook would become a shallow wrapper for functions on the form context.

useField would become:

export function useField(path, {form = useContext(), ...config} ={}) {
   return form.getField(path, config);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions