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

null is not an object (evaluating e.endCoordinates) #31

Open
weinbergdavid opened this issue Aug 27, 2019 · 1 comment
Open

null is not an object (evaluating e.endCoordinates) #31

weinbergdavid opened this issue Aug 27, 2019 · 1 comment

Comments

@weinbergdavid
Copy link

Bug

I use useKeyboard hook, and when the keyboard is closing I got an error null is not an object (evaluating e.endCoordinates).

Screenshot_20190827-124808

Environment info

React native info output:

info
  React Native Environment Info:
    System:
      OS: Windows 10
      CPU: (4) x64 Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
      Memory: 5.21 GB / 15.88 GB
    Binaries:
      Yarn: 1.16.0 - C:\Users\David\Projects\WI\personalized-nutrition-app\node_modules\.bin\yarn.CMD
      npm: 6.5.0 - C:\Program Files\nodejs\npm.CMD
    IDEs:
      Android Studio: Version  3.0.0.0 AI-171.4408382

Done in 3.07s.

Library version: 0.9.0

Steps To Reproduce

  1. Add useKeyboard. show a text only if the keyboard is close.
  2. Open the keyboard.
  3. After you close the keyboard you got the error and the text still hidden.

Describe what you expected to happen:

  1. I expect that the text will appear again.

Reproducible sample code

import { useKeyboard } from 'react-native-hooks'
...
const { isKeyboardShow } = useKeyboard()
return (

{!isKeyboardShow && Test useKeyboard}

</View>

)

Possible fix:

Instead of writing endCoordinates: e.endCoordinates, write endCoordinates: e ? e.endCoordinates : null,

@pvinis
Copy link
Member

pvinis commented Feb 16, 2020

Which RN version is this happening on? Is this still relevant? Also, could you try with the latest @react-native-community/hooks?

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 a pull request may close this issue.

2 participants