rili-live / react-native-phone-input

Phone input box for React Native
https://www.npmjs.com/package/react-native-phone-input
MIT License
42 stars 54 forks source link

How would I access isFocused? #53

Closed Revolt9k closed 11 months ago

Revolt9k commented 11 months ago

ref.current.textInput.isFocused() does not work properly because it's not upadting after got first time focused and also there is TS error when i try to reach ref.current.textInput

Also there is no way to add any functional to onFocus or/and onBlur listeners.

Is there any ways to get isFocused directly?

Revolt9k commented 11 months ago

I got some workaround.

first run const [isFocused, setFocused] = useState(false); then

     textProps={{
          onFocus: () => setFocused(true),
          onBlur: () => setFocused(false),
        }}