diff --git a/README.md b/README.md index 6bcfdcc4c..f59c04feb 100644 --- a/README.md +++ b/README.md @@ -759,7 +759,7 @@ class App extends React.Component<{ message: string }, { count: number }> { [View in the TypeScript Playground](https://www.typescriptlang.org/play/?jsx=2#code/JYWwDg9gTgLgBAJQKYEMDG8BmUIjgcilQ3wFgAoCtAGxQGc64BBMMOJADxiQDsATRsnQwAdAGFckHrxgAeAN5wQSBigDmSAFxw6MKMB5q4AXwA0cRWggBXHjG09rIAEZIoJgHwWKcHTBTccAC8FnBWtvZwAAwmANw+cET8bgAUAJTe5L6+RDDWUDxwKQnZcLJ8wABucBA8YtTAaADWQfLpwV4wABbAdCIGaETKdikAjGnGHiWlFt29ImA4YH3KqhrGsz19ugFIIuF2xtO+sgD0FZVTWdlp8ddH1wNDMsFFKCCRji5uGUFe8tNTqc4A0mkg4HM6NNISI6EgYABlfzcFI7QJ-IoA66lA6RNF7XFwADUcHeMGmxjStwSxjuxiAA) -**Class Properties**: If you need to declare class properties for later use, just declare it like `state`, but without assignment: +**Class Properties**: If you need to declare class properties for later use, define them directly within the class `body` without an initial assignment: ```tsx class App extends React.Component<{ diff --git a/docs/basic/getting-started/class-components.md b/docs/basic/getting-started/class-components.md index e04aecb50..1c9cdf5e0 100644 --- a/docs/basic/getting-started/class-components.md +++ b/docs/basic/getting-started/class-components.md @@ -84,7 +84,7 @@ class App extends React.Component<{ message: string }, { count: number }> { [View in the TypeScript Playground](https://www.typescriptlang.org/play/?jsx=2#code/JYWwDg9gTgLgBAJQKYEMDG8BmUIjgcilQ3wFgAoCtAGxQGc64BBMMOJADxiQDsATRsnQwAdAGFckHrxgAeAN5wQSBigDmSAFxw6MKMB5q4AXwA0cRWggBXHjG09rIAEZIoJgHwWKcHTBTccAC8FnBWtvZwAAwmANw+cET8bgAUAJTe5L6+RDDWUDxwKQnZcLJ8wABucBA8YtTAaADWQfLpwV4wABbAdCIGaETKdikAjGnGHiWlFt29ImA4YH3KqhrGsz19ugFIIuF2xtO+sgD0FZVTWdlp8ddH1wNDMsFFKCCRji5uGUFe8tNTqc4A0mkg4HM6NNISI6EgYABlfzcFI7QJ-IoA66lA6RNF7XFwADUcHeMGmxjStwSxjuxiAA) -**Class Properties**: If you need to declare class properties for later use, just declare it like `state`, but without assignment: +**Class Properties**: If you need to declare class properties for later use, define them directly within the class `body` without an initial assignment: ```tsx class App extends React.Component<{