Replies: 1 comment 3 replies
-
@nonoumasy Did you get the solution? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
@wellyshen
I'm trying to use RHF with UPA.
..
Still new to RHF 7. I got simple inputs like TextField to work but when working with other libraries such as use-places-autocomplete, I'm still unsure how to use the Controller effectively. I think the problem is that somehow the value returned by use-places-autocomplete is not wired up to RHF so its not returning it as part of the RHF data object.
I think this is because onChange is using the handleInput from UPA. How do I wire this up so that whatever handleInput returns is passed to RHF onChange?
Someone suggested:
"Your TextField is getting its value from useAutoComplete and not from RHF itself." so how would I pass it to RHF. Would I need to setup a state for this and return that seperately?
https://codesandbox.io/s/rhf-7-with-reusable-component-m9njl?file=/src/components/GooglePlacesAutocomplete.js:64-87
I did find a Youtube video which shows how to do this but for another library:
https://youtu.be/NxYUYcGBaOI?t=381
should I do something like
Beta Was this translation helpful? Give feedback.
All reactions