react-contexify
react-contexify copied to clipboard
TypeError: event.stopPropagation is not a function in 6.0.0
TypeError: event.stopPropagation is not a function
When I was integrating the react-contexify plugin and running my project, the error "TypeError: event.stopPropagation is not a function" appeared when I right-click. I am using version 6.0.0
me too
Working version:
const { show } = useContextMenu({
id: 'card_context_menu'
})
<Col xl='3' md='4' sm='6' onClick={show}></Col>
<Menu id='card_context_menu'>
<Item onClick={() => handleCopy(request)}>{intl.formatMessage({ id: 'copy' })}</Item>
</Menu>
TypeError: event.stopPropagation is not a function
const { show } = useContextMenu({
id: 'card_context_menu'
})
function displayMenu(e) {
show({
event: e
})
}
<Col xl='3' md='4' sm='6' onClick={displayMenu}></Col>
<Menu id='card_context_menu'>
<Item onClick={() => handleCopy(request)}>{intl.formatMessage({ id: 'copy' })}</Item>
</Menu>
e Object in displayMenu is a SyntheticBaseEventÂ
The parameter event of the show function requires a domevent. The domevent of some events does not exist stopPropagation.