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

Direct DOM mutation for fields #9

Open
loganvolkers opened this issue Apr 10, 2022 · 1 comment
Open

Direct DOM mutation for fields #9

loganvolkers opened this issue Apr 10, 2022 · 1 comment
Labels
question Further information is requested

Comments

@loganvolkers
Copy link

Is your feature request related to a problem? Please describe.

React hook form has shown that direct DOM manipulation works in place of the classic react controlled component pattern.

Describe the solution you'd like

Improve hooks and examples to support this pattern.

Describe alternatives you've considered

React controlled components, or a wrapper around field atom.

Additional context

Great library, well typed and documented! Happy to contribute PRs.

@jaredLunde
Copy link
Collaborator

jaredLunde commented Apr 12, 2022

Thanks for commenting! I made this library because I dislike react-hook-form uncontrolled components and formik has poor re-render optimization. They're almost never what you want in my experience and I have struggled mightily to get them to work for a wide range of use cases. Lastly, I think if you want uncontrolled inputs you don't really need a library for that - just read the form values on submit. Hence the feature bullet:

  • Controlled inputs because no, uncontrolled inputs are not preferrable

I think you'll find that this library performs just as well in the real world - probably better when you're creating a form with complex validations and dependencies.

For those reasons and for the sake of less API surface area (react-hook-form is confusing in this way, too), I would not accept a PR adding uncontrolled inputs.

@jaredLunde jaredLunde added the question Further information is requested label Mar 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants