Add contextmenu to your react component with ease
npm install @apitable/react-contexifyUsing yarn
``sh`
$ yarn add @apitable/react-contexify
Using npm
`sh`
$ npm install --save @apitable/react-contexify
`js
import React from 'react';
import { Menu, Item, Separator, Submenu, MenuProvider } from '@apitable/react-contexify';
import '@apitable/react-contexify/dist/ReactContexify.css';
const MENU_ID = 'blahblah';
function App() {
const { show } = useContextMenu({
id: MENU_ID,
});
function handleContextMenu(event){
event.preventDefault();
show({
event,
props: {
key: 'value'
}
})
}
const handleItemClick = ({ event, props }) => console.log(event,props);
return (
lorem ipsum blabladhasi blaghs blah
React Contexify is licensed under MIT.