Add contextmenu to your react component with ease
npm install @ishikawa_masashi/react-contexify
!React-contexify CI ![npm]() ![npm]() ![license]()
Go here.
Using yarn
``sh`
$ yarn add react-contexify
Using npm
`sh`
$ npm install --save react-contexify
`js
import React from 'react';
import { Menu, Item, Separator, Submenu, MenuProvider } from 'react-contexify';
import '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
Any idea and suggestions are welcome. Please have a look at the contributing guide.
React Contexify is licensed under MIT.