react-native-hold-menu icon indicating copy to clipboard operation
react-native-hold-menu copied to clipboard

Cannot navigate onPress

Open jameskim917 opened this issue 3 years ago • 1 comments

<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

jameskim917 avatar May 30 '22 08:05 jameskim917

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.

enesozturk avatar Jul 19 '22 22:07 enesozturk