Skip to content

Conversation

@bausmeier
Copy link

When making use of useRef for refs forwarded to a custom functional
component there is potential for the isFocused function not to be
defined. Adding some extra checks to make sure that it is a function
before calling it prevents an error from being thrown.

When making use of useRef for refs forwarded to a custom functional
component there is potential for the isFocused function not to be
defined. Adding some extra checks to make sure that it is a function
before calling it prevents an error from being thrown.
@richardgirges
Copy link

It would be great to get this one merged! We're running into scenarios where the ref may be null.

@terryatgithub
Copy link

yes, come across the same issue, pls help solve it asap, thanks alot

TypeError: Cannot read property 'isFocused' of null
at KeyboardAwareBase.js:84
at Array.some ()
at KeyboardAwareScrollView._scrollToFocusedTextInput (KeyboardAwareBase.js:83)
at KeyboardAwareScrollView._onKeyboardWillShow (KeyboardAwareBase.js:98)
at RCTDeviceEventEmitter.emit (EventEmitter.js:189)
at MessageQueue.__callFunction (MessageQueue.js:416)
at MessageQueue.js:109
at MessageQueue.__guard (MessageQueue.js:364)
at MessageQueue.callFunctionReturnFlushedQueue (MessageQueue.js:108)
at debuggerWorker.aca173c4.js:4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants