Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
xiduzo committed Dec 15, 2024
1 parent 550dd0f commit b9e4062
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions apps/nextjs-app/app/docs/contributing/nodes/page.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@ export type MyNodeData = {
emotion: EmotionType;
joy: number;
};
type MyNodeOptions = BaseComponentOptions & MyNodeData;
```

Add a constructor to your type that takes the attributes and passes them to the superclass. Like this:

```
constructor(private readonly options: MyNodeOptions) {
super(options, 0);
constructor(private readonly data: BaseComponentData & MyNodeData) {
super(data, 0);
}
```

Expand Down Expand Up @@ -93,7 +91,7 @@ function Settings() {
- And your panel setting defaults.

```
type Props = BaseNode<MyNodeData, MyNodeValueType>;
type Props = BaseNode<MyNodeData>;
export const DEFAULT_MYNODE_DATA: Props['data'] = {
label: 'MyNode',
emotion: 'happy',
Expand Down Expand Up @@ -124,10 +122,10 @@ DEFAULT_MYNODE_DATA.set('MyNode', DEFAULT_MYNODE_DATA);
- Add some JSX in `apps/electron-app/src/render/NewNodeProvider.tsx` so that it appears in the search menu.
```
<CommandItem onSelect={selectNode('MyNode')}>
MyNode
<CommandShortcut>
<Badge variant="outline">Custom</Badge>
</CommandShortcut>
</CommandItem>
<CommandItem onSelect={selectNode('MyNode')}>
MyNode
<CommandShortcut>
<Badge variant="outline">Custom</Badge>
</CommandShortcut>
</CommandItem>
```

0 comments on commit b9e4062

Please sign in to comment.