From ac4929ac22e31314d5a5bc8c64d8f3b042d23467 Mon Sep 17 00:00:00 2001 From: Martin Oppitz Date: Tue, 26 Jul 2022 22:19:02 +0200 Subject: [PATCH] docs: add a component type parameter paragraph --- src/docs/components/component.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/docs/components/component.md b/src/docs/components/component.md index e067a0fab..b04c97205 100644 --- a/src/docs/components/component.md +++ b/src/docs/components/component.md @@ -134,3 +134,23 @@ export class MyParentComponent { ``` The `my-parent-component` includes a reference to the `my-embedded-component` in the `render()` function. + +## Using Type Parameters + +It is now also possible to use so-called type parameters for component classes. The following example shows how they are used: + +```tsx +import { Component, h, Prop } from '@stencil/core'; + +@Component({ + tag: 'my-table' +}) +export class MyTable { + + @Prop() public _data!: T; + + ... +} +``` + +> If you want to use nested type parameters, then simply substitute non-nested type parameters.