react-native-hold-menu
react-native-hold-menu copied to clipboard
Cannot navigate onPress
<HoldItem
items={[
{ text: 'Edit', icon: 'pencil', onPress: (term, definition) => { navigation.navigate('EditWord', { term, definition }) } },
{ text: 'Delete', icon: 'trash', isDestructive: true, onPress: () => { } }
]}
actionParams={{ Edit: [word.term, word.definition] }} bottom={true}
>
onPress is unable to navigate to another screen
I am able to use the navigation on both Android and iOS. Here is the demo.
const { goBack } = useNavigation();
const items = [
{
text: 'Home',
icon: 'home',
onPress: () => {
goBack();
},
}
]
https://user-images.githubusercontent.com/19428358/179858074-bf68d476-9398-4dee-9025-fbe236fd154d.mov
Do you think you're calling the navigation in the right place? Cannot repro and guess the problem with the current code snippets.