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

<Controller>'s control prop should be optional (useFormContext) #740

Closed
kusmierz opened this issue Dec 29, 2019 · 3 comments
Closed

<Controller>'s control prop should be optional (useFormContext) #740

kusmierz opened this issue Dec 29, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@kusmierz
Copy link
Contributor

Is your feature request related to a problem? Please describe.
<Controller> component has to have control prop defined, even when using <FormContext>. Maybe it would be possible to use const { control } = useFormContext() in case there is no control prop directly passed?

Describe the solution you'd like
I'd love to don't repeat myself and use clean and clear <Controller> component without passing additional control each and every time.

Describe alternatives you've considered
Previously, React Hook Form input worked as described above.

Additional context
https://github.com/react-hook-form/react-hook-form-input/blob/master/src/index.tsx#L55-L58

@kusmierz kusmierz changed the title <Controller>'s control should be optional (useFormContext) <Controller>'s control prop should be optional (useFormContext) Dec 29, 2019
@bluebill1049 bluebill1049 added the enhancement New feature or request label Dec 29, 2019
@kusmierz
Copy link
Contributor Author

That was quick, thank you very much @bluebill1049!

@bluebill1049
Copy link
Member

pleasure @kusmierz I am working on RHF, may as well as get this one in.

@bluebill1049
Copy link
Member

should be on the next minor release.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants