Skip to content

Commit 06b707c

Browse files
committed
docs: fix typo
1 parent 81f6f97 commit 06b707c

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

docs/components/defining.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Define a Jwc component by creating a class that extends `JwcComponent` or a func
55
::: code-group
66

77
```tsx [Class Based]
8-
@JwcComponent({ name: "app-element" })
8+
@Component({ name: "app-element" })
99
export class App extends JwcComponent {
1010
/* ... */
1111
}
@@ -19,13 +19,13 @@ export class App extends JwcComponent {
1919

2020
## Class Based
2121

22-
The `@JwcComponent` decorator is used to define a Jwc component. It takes an object with the following properties:
22+
The `@Component` decorator is used to define a Jwc component. It takes an object with the following properties:
2323

2424
- `name` - The name of the component. This is used to identify the component in the DOM. It must be unique.
2525
- [`css`](./styles.md) - The CSS to be applied to the component. The CSS is applied to the shadow DOM of the component.
2626
- `options` - The options to be passed to the component. Follows the ElementDefinitionOptions interface from the [Custom Elements API](https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/define#Parameters).
2727

28-
I recommend you do not use JavaScript to define your component. Instead, use TypeScript. This will allow you to use the `@JwcComponent` decorator to define your component.
28+
I recommend you do not use JavaScript to define your component. Instead, use TypeScript. This will allow you to use the `@Component` decorator to define your component.
2929

3030
But if you do use JavaScript or you want to define without using the decorator:
3131

@@ -35,7 +35,7 @@ But if you do use JavaScript or you want to define without using the decorator:
3535
/* ... */
3636
}; // [!code ++]
3737

38-
@JwcComponent({ name: "app-element" /* ... */ }) // [!code --]
38+
@Component({ name: "app-element" /* ... */ }) // [!code --]
3939
export class App extends JwcComponent {
4040
constructor() {
4141
super();
@@ -65,7 +65,7 @@ export class App extends JwcComponent {
6565
```
6666

6767
::: warning
68-
Although you can define a component without using the `@JwcComponent` decorator, it is not recommended. We won't use that in our documentation.
68+
Although you can define a component without using the `@Component` decorator, it is not recommended. We won't use that in our documentation.
6969
:::
7070

7171

docs/components/lifecycle.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ In class-based components, you can override these methods. In function-based com
2121
The constructor is called when the component is created. This is where you can initialize the component.
2222

2323
```ts
24-
@JwcComponent({ name: "app-element" })
24+
@Component({ name: "app-element" })
2525
export class App extends JwcComponent {
2626
constructor() {
2727
super();
@@ -37,7 +37,7 @@ Jwc will get the `options` property from the `@JwcComponent` decorator and pass
3737
The connected callback is called when the component is added to the DOM.
3838

3939
```ts
40-
@JwcComponent({ name: "app-element" })
40+
@Component({ name: "app-element" })
4141
export class App extends JwcComponent {
4242
override connectedCallback() {
4343
super.connectedCallback();
@@ -57,7 +57,7 @@ At last, Jwc will render the component in the `connectedCallback` method and app
5757
The disconnected callback is called when the component is removed from the DOM.
5858

5959
```ts
60-
@JwcComponent({ name: "app-element" })
60+
@Component({ name: "app-element" })
6161
export class App extends JwcComponent {
6262
override disconnectedCallback() {
6363
super.disconnectedCallback();
@@ -75,7 +75,7 @@ Jwc will remove the rendered result from the shadowRoot in the `disconnectedCall
7575
The attribute changed callback is called when an attribute of the component is changed.
7676

7777
```ts
78-
@JwcComponent({ name: "app-element" })
78+
@Component({ name: "app-element" })
7979
export class App extends JwcComponent {
8080
override attributeChangedCallback(
8181
name: string,
@@ -97,7 +97,7 @@ Jwc will update dom in the `attributeChangedCallback` method.
9797
The adopted callback is called when the component is moved to a new document.
9898

9999
```ts
100-
@JwcComponent({ name: "app-element" })
100+
@Component({ name: "app-element" })
101101
export class App extends JwcComponent {
102102
override adoptedCallback() {
103103
super.adoptedCallback();

docs/components/reactive-properties.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Jwc components have reactive properties. These properties are automatically upda
1010
::: code-group
1111

1212
```tsx [Class Based]
13-
@JwcComponent({ name: "app-element" })
13+
@Component({ name: "app-element" })
1414
export class App extends JwcComponent {
1515
@Prop() name: string = "World";
1616
override render() {

docs/components/rendering.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ You have 2 choices for rendering a component:
55
::: code-group
66

77
```tsx [Class Based]
8-
@JwcComponent({ name: "app-element" })
8+
@Component({ name: "app-element" })
99
export class App extends JwcComponent {
1010
/* ... */
1111
override render() {

docs/publish/typescript.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ When you define a web components, TypeScript doesn't know anything about it, all
77
## Define for TypeScript
88

99
```ts
10-
@JwcComponent({ name: "app-element" })
10+
@Component({ name: "app-element" })
1111
export class App extends JwcComponent {
1212
@Prop() name: string = "World";
1313
override render() {

0 commit comments

Comments
 (0)