Skip to content

Commit ac6771e

Browse files
[docs] Fix 'property' has no initializer issue in TypeScript property samples (#1274)
1 parent ee60e5a commit ac6771e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/lit-dev-content/site/docs/v2/components/properties.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Lit components receive input and store their state as JavaScript class fields or
1616
```ts
1717
class MyElement extends LitElement {
1818
@property()
19-
name: string;
19+
name?: string;
2020
}
2121
```
2222

@@ -83,7 +83,7 @@ Use the `@property` decorator with a class field declaration to declare a reacti
8383
```ts
8484
class MyElement extends LitElement {
8585
@property({type: String})
86-
mode: string;
86+
mode?: string;
8787

8888
@property({attribute: false})
8989
data = {};

packages/lit-dev-content/site/docs/v3/components/properties.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Lit components receive input and store their state as JavaScript class fields or
1616
```ts
1717
class MyElement extends LitElement {
1818
@property()
19-
name: string;
19+
name?: string;
2020
}
2121
```
2222

@@ -83,7 +83,7 @@ Use the `@property` decorator with a class field declaration to declare a reacti
8383
```ts
8484
class MyElement extends LitElement {
8585
@property({type: String})
86-
mode: string;
86+
mode?: string;
8787

8888
@property({attribute: false})
8989
data = {};

0 commit comments

Comments
 (0)