diff --git a/js/components/ContextMenu.tsx b/js/components/ContextMenu.tsx index e6355865..5fa12619 100644 --- a/js/components/ContextMenu.tsx +++ b/js/components/ContextMenu.tsx @@ -98,27 +98,25 @@ interface ContextMenuProps { zIndex: number; } -class ContextMenu extends React.Component { - render() { - const { - children, - offsetTop, - offsetLeft, - top, - bottom, - selected, - zIndex, - } = this.props; - return ( - selected && ( - - - - ) - ); +function ContextMenu({ + children, + offsetTop, + offsetLeft, + top, + bottom, + selected, + zIndex, +}: ContextMenuProps) { + if (!selected) { + return null; } + return ( + + + + ); } const mapStateToProps = (state: AppState) => ({