You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Quite new to to react and using typescript with it. Also not sure if this is the right way to as these questions, but the documentation and examples could do with some additional clarity in my opinion.
I am confused by the example below as it does not explain or show how this onContextMenu is supposed to be used. So if it is mandatory, I'm sure there should be some implementation for it too.
import { ContextMenuTarget, Menu, MenuItem } from "@blueprintjs/core";
const RightClickMe = ContextMenuTarget(class RightClickMeWithContext extends React.Component {
render() {
// root element must support `onContextMenu`
return <div>{...}</div>;
}
renderContextMenu() {
// return a single element, or nothing to use default browser behavior
return (
<Menu>
<MenuItem onClick={this.handleSave} text="Save" />
<MenuItem onClick={this.handleDelete} text="Delete" />
</Menu>
);
}
onContextMenuClose() {
// Optional method called once the context menu is closed.
}
});
After searching the repository a bit I could at least find out that the function needs to be in form of something like the following:
Additionally the example seems to be missing the wiring of the props. So could someone help me figure out a more comprehensive example that does not leave these gaps? Thanks!
The text was updated successfully, but these errors were encountered:
I think my only problem now after proper digging through the example is with that type error I get. I do get it also after using e.g. the decorator example in plain react app created with redux-typescript template.
Quite new to to react and using typescript with it. Also not sure if this is the right way to as these questions, but the documentation and examples could do with some additional clarity in my opinion.
I am confused by the example below as it does not explain or show how this
onContextMenu
is supposed to be used. So if it is mandatory, I'm sure there should be some implementation for it too.After searching the repository a bit I could at least find out that the function needs to be in form of something like the following:
Additionally the example seems to be missing the wiring of the props. So could someone help me figure out a more comprehensive example that does not leave these gaps? Thanks!
The text was updated successfully, but these errors were encountered: