You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This question is a bit off topic but I haven't gotten an answer to my question in other forums and maybe someone can shed some light for me?
Basically, I'm using GooglePlacesAutocomplete in my react-native app. Since the component does not provide an onPress method for the TextInput component which would normally detect a touch gesture, I would like to use the isFocused method which according to documentation, "returns true if the TextInput is currently focused; false otherwise". My question is, how can I use isFocused to dynamically change the UI based on the return value? I would like to be able to alter my UI in case the method evaluates to either true/false.
I've provided my setup below. As you can see, as an example, I would like my view to show "Hello" if isFocused evaluates to true and "Hi" if false however this implementation does not obviously won't work for what I'm trying to do.
Reproduction - (required - issue will be closed without this)
Steps to reproduce the behavior - a minimal reproducible code example, link to a snack or a repository.
Same here. I tried creating a focused state and using the onFocus and onBlur functions sending it to textInputProps. It works but generates side effects, making extra calls to fetch predictions. Otherwise, ref.current.isFocused() doesn't work for what we need because refs don't cause renderings, so when the value changes the interface won't know
Describe the problem
This question is a bit off topic but I haven't gotten an answer to my question in other forums and maybe someone can shed some light for me?
Basically, I'm using GooglePlacesAutocomplete in my react-native app. Since the component does not provide an onPress method for the TextInput component which would normally detect a touch gesture, I would like to use the isFocused method which according to documentation, "returns true if the TextInput is currently focused; false otherwise". My question is, how can I use isFocused to dynamically change the UI based on the return value? I would like to be able to alter my UI in case the method evaluates to either true/false.
I've provided my setup below. As you can see, as an example, I would like my view to show "Hello" if isFocused evaluates to true and "Hi" if false however this implementation does not obviously won't work for what I'm trying to do.
Reproduction - (required - issue will be closed without this)
Steps to reproduce the behavior - a minimal reproducible code example, link to a snack or a repository.
Please provide a FULLY REPRODUCIBLE example.
Click to expand!
Please remember to remove you google API key from the code you provide here
Additional context
Library Version: [e.g. 1.4.2]
React Native Version: [e.g. 0.62.2]
iOS
Android
Web
If you are using expo please indicate here:
Add any other context about the problem here, screenshots etc
The text was updated successfully, but these errors were encountered: