bsr-context-menu
v2.2.47
Published
React component context menu
Downloads
6
Readme
bsr-context-menu
React component context menu
Install
npm install --save bsr-context-menu
Usage
import React, {useRef} from 'react';
import {useContextMenu} from 'bsr-context-menu';
import 'bsr-context-menu/dist/index.css'
function Body(text:string){
return(
<div style={{width:200,cursor:'pointer'}}>
<div>{text}:1</div>
<div>{text}:2</div>
<div>{text}:3</div>
<div>{text}:4</div>
</div>
)
}
export function P10_1(){
const mRefMenu=useRef(null);
useContextMenu(mRefMenu,Body('Menu'))
return <div ref={mRefMenu} style={{width:100,height:100,background:'grey'}}/>
}
License
MIT © ionson100