Skip to content

Commit

Permalink
doc: Update widgets.md (#610)
Browse files Browse the repository at this point in the history
- content seems to be .tsx not .ts
- typo in the widget command
  • Loading branch information
srl295 authored Oct 3, 2024
1 parent 53f0d5b commit df2fa9b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/docs/widgets.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ In the following code examples, we use `ReactWidget` as a base class. As shown b
* `closable`: Whether the user can close the widget (via the “x” in the tab or via right click menu).
* `iconClass`: The icon shown in the tab when the widget is opened.

**mywidget-widget.ts**
**mywidget-widget.tsx**

```typescript
@injectable()
Expand All @@ -83,7 +83,7 @@ protected async init(): Promise < void> {
When using the respective base class, the implementation of a widget can be really minimal and focused on the custom UI part. In our example, we just implement the render function that will create our actual custom UI (using JSX/React). The example UI contains a button that will trigger the `displayMessage` function below.
**mywidget-widget.ts**
**mywidget-widget.tsx** (continued)
```typescript
protected render(): React.ReactNode {
Expand Down Expand Up @@ -151,7 +151,7 @@ export class MyWidgetContribution extends AbstractViewContribution<MyWidget> {
}

registerCommands(commands: CommandRegistry): void {
commands.registerCommand(WidgetCommand, {
commands.registerCommand(MyWidgetCommand, {
execute: () => super.openView({ activate: false, reveal: true })
});
}
Expand Down

0 comments on commit df2fa9b

Please sign in to comment.