Skip to content

Commit

Permalink
Merge pull request #221 from unyt-org/jonasstrehle-patch-1
Browse files Browse the repository at this point in the history
Update 04 Components.md
  • Loading branch information
jonasstrehle authored Dec 14, 2024
2 parents c2e6751 + 8f920f8 commit 506ce14
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions docs/manual/04 Components.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,22 +283,22 @@ const parent =
Class components extending the `Component` class will expose methods to handle the components lifecyle.

```typescript
@Component
@template
class CustomComponent extends Component {
// called when component is constructed
onConstruct() {}
protected override onConstruct(): Promise<void> | void { }

// called after component is constructed or restored
onInit() {}
protected override onInit(): Promise<void> | void { }

// called once before onAnchor
onCreate() {}
protected override onCreate(): void | Promise<void> { }

// called every time the component is added to a new parent in the DOM
onAnchor() {}
protected override onAnchor(): void | Promise<void> { }

// called after onAnchor when the component is displayed in a browser context
onDisplay() {}
protected override onDisplay(): void | Promise<void> { }
}
```

Expand All @@ -325,4 +325,4 @@ Component children are part of the component state and are restored when the com

## Component styling

See [Styles and Themes](./12%20Style%20and%20Themes.md).
See [Styles and Themes](./12%20Style%20and%20Themes.md).

0 comments on commit 506ce14

Please sign in to comment.