Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
10xjs opened this issue Sep 25, 2019 · 0 comments

Comments

@10xjs
Copy link
Owner

10xjs commented Sep 25, 2019

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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant