dominicstop / react-native-ios-context-menu

A react-native component to use context menu's (UIMenu) on iOS 13/14+
MIT License
515 stars 23 forks source link

Cannot use inside Animated.FlatList #79

Open morajabi opened 8 months ago

morajabi commented 8 months ago

It opens correctly but on close it crashes the app.

https://github.com/dominicstop/react-native-ios-context-menu/assets/12202757/73e821d5-682e-4ac6-bc55-2b1fc967e9d9

CleanShot 2023-11-04 at 13 18 31@2x

error

Error: domain: react-native-ios-utilities - code: nilReactBridge - description: Unable to get ref. to react bridge - fileName: /Users/mo/dev/noor/node_modules/react-native-ios-utilities/ios/Sources/Helpers/RNIModuleHelpers.swift - functionName: getReactBridge(withErrorType:) - lineNumber: 18 - columnNumber: 27
nandorojo commented 8 months ago

Possible duplicate or #70

nandorojo commented 8 months ago

Have you tried FlashList

nandorojo commented 8 months ago

And are you on RN 0.72.5+

morajabi commented 8 months ago

Unfortunately FlashList falls short for inverted usecase, messages frequently overlap over each other and it doesn't support sticky items properly while inverted. We recently had to switch to FlatList. We use RN 0.72.6.

nandorojo commented 8 months ago

And making FlashList not be animated fixes it?

morajabi commented 8 months ago

@nandorojo Yes. But also I noticed a new thing. Clicking one of our menu items caused the crash, but in production it was fine.

nandorojo commented 8 months ago

In my case, quitting the dev app and restarting fixed this

morajabi commented 8 months ago

I'll try again with Animated FlatList with this suggestion