react-nativereact-native-gifted-chat

Disable native context menu in react native gifted chat


In my react-native-gifted-chat application I want to use my custom context menu when long pressing message bubble. So I use react-native-context-menu-view like below.

const ChatContextMenu = ({bubbleProps}: Props) => {
    
    return (
        <ContextMenu
            actions={[{title: 'Delete'}]}
            onPress={(event) => {
                if (event.nativeEvent.name === 'Delete') {
                    console.log('deleting...')
                }
            }}
        >
            <Bubble
                {...bubbleProps}
            />
        </ContextMenu>
    )
}

And it works but when I long press the bubble, also the native context menu appears like in the photo below

enter image description here

How can I disable this?


Solution

  • <GiftedChat
      onLongPress={()=> {}}