Skip to content

Commit 07e5b2f

Browse files
Update README.md
1 parent 0058e6b commit 07e5b2f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Within Typescript, `React.Component` is a generic type (aka `React.Component<Pro
9999

100100
```tsx
101101
class App extends React.Component<{
102-
message: string, // like this
102+
message: string, // it takes one prop called 'message' which is a string type
103103
}> {
104104
render() {
105105
return (
@@ -113,9 +113,9 @@ If the component has state, here's how to add the types for the state:
113113

114114
```tsx
115115
class App extends React.Component<{
116-
message: string,
116+
message: string, // this is the prop type
117117
}, {
118-
count: number, // like this
118+
count: number, // this is the state type
119119
}> {
120120
state = {
121121
count: 0

0 commit comments

Comments
 (0)