akveo / react-native-ui-kitten

:boom: React Native UI Library based on Eva Design System :new_moon_with_face::sparkles:Dark Mode
https://akveo.github.io/react-native-ui-kitten/
MIT License
10.19k stars 952 forks source link

OverflowMenu throws error `Argument 0 (NSNumber) of UIManager.measureInWindow must not be null` #1751

Open AnsonT opened 1 year ago

AnsonT commented 1 year ago

🐛 Bug Report

In some rendering conditions, e.g. using overflow within an item in FlatList can throw this error: Argument 0 (NSNumber) of UIManager.measureInWindow must not be null

To Reproduce

Steps to reproduce the behavior:

Unfortunately, I haven't been able to create a shorter repo, but the scenario involves loading item dynamically for a FlatList. Each item includes an OverflowMenu

Expected behavior

No error is thrown

ERROR

The error occurs in src/components/devsupport/components/measure/measure.component.tsx:

  const measureSelf = (): void => {
    const node: number = findNodeHandle(ref.current);
    UIManager.measureInWindow(node, onUIManagerMeasure);
  };

node is sometimes null

UI Kitten and Eva version

Package Version
@eva-design/eva 2.2.0
@ui-kitten/components 5.3.1

Environment information

System: OS: macOS 13.4 CPU: (10) arm64 Apple M1 Max Binaries: Node: 18.15.0 - ~/.asdf/installs/nodejs/lts-hydrogen/bin/node Yarn: 1.22.19 - /opt/homebrew/bin/yarn npm: 9.5.0 - ~/.asdf/plugins/nodejs/shims/npm Watchman: 2023.05.22.00 - /opt/homebrew/bin/watchman SDKs: iOS SDK: Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4 IDEs: Android Studio: 2022.1 AI-221.6008.13.2211.9619390 Xcode: 14.3.1/14E300c - /usr/bin/xcodebuild npmPackages: react: 18.2.0 => 18.2.0 react-native: 0.71.7 => 0.71.7

josmmv commented 1 year ago

I'm getting this error too. I applied this change https://github.com/akveo/react-native-ui-kitten/pull/1752/commits/01ac76a0d34f5028655206e4489fc749697ba015 mentioned in the pull request #1752 and it worked.