Open PierrotAWB opened 1 year ago
hi, thank you for submitting an issue; i’ll try to debug this in the weekend ahakhskdkffkfjl
this might be (another) bug with the cleanup logic, or maybe the changes to the menuConfig prop is not being detected?
hopefully, it’s not too hard to fix
It's possible this is due to react-freeze
. I wonder if toggling enableFreeze
from react-native-screens
changes anything.
@PierrotAWB can you try adding this to the child of the context menu:
<Pressable delayLongPress={100} onLongPress={() => {}}>
{child}
</Pressable>
First, thanks to those who've worked on this library. Aside from this singular problem, it's been a pleasure working in it.
I'm facing an issue which is similar to, but as far as I can tell, distinct from #34.
The goal is to implement a 'like' button on a
ContextMenuView
. Each time the button's clicked, it toggles a state variable and the UI should update accordingly. This change should persist even as the menu's hidden (if I 'like', then hide the menu and open it again, it should still indicate that I've 'liked').I've produced a minimal example to illustrate the problem: although the button works initially, as soon as I navigate to another tab and back, it stops re-rendering properly. Both the UI and a
console.log()
I've included in the code indicate that the state variable (favourite
) holds the correct value at all times. The issue is that it's no longer the case that clicking 'like' is immediately reflected in the UI (the menu does not re-render properly).https://github.com/dominicstop/react-native-ios-context-menu/assets/20756534/dc9e42e5-0a76-47c8-9c0c-81cc27e89ccc
Environment: