react-leaflet-context-menu is the react version of leaflet.contextmenu. However it uses the original leaflet map to realize the plugin in react but not using react-leaflet.
I adopted react-leaflet in my app, using component. I went through Internet but not many example to show how to extend Map correctly.
Here is my code for map in my app:
<LeafletMap
ref={m => {this.leafletMap = m;}}
center={this.state.center}
zoom={this.state.zoom}
maxZoom={this.state.maxZoom}
preferCanvas={this.state.preferCanvas}
contextmenu={this.state.contextmenu}
contextmenuWidth={this.state.contextmenuWidth}
contextmenuItems={this.state.contextmenuItems}>
<TileLayer
url={mapsource}
/>
<MarkerClusterGroup showCoverageOnHover={false} zoomToBoundsOnClick={false} maxClusterRadius={30}>
{CamMarkers}
</MarkerClusterGroup>
<ScaleControl imperial={false} metric={true}/>
</LeafletMap>
I expect by extending component of react-leaflet, it can support leaflet.contextmenu directly. The props contextmenu, contextmenuWidth, contextmenuItems will be input to the extended component and will show some control upon right click on map.