Skip to content

Commit 623a1d0

Browse files
authored
Merge pull request #103 from VanTanev/improve-default-props-example
[Basic] Improve the class component defaultProps example
2 parents 18009b2 + 6a467f6 commit 623a1d0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ export class Greet extends React.Component<Props> {
445445
const { name } = this.props;
446446
return <div>Hello ${name.toUpperCase()}!</div>;
447447
}
448-
static defaultProps = { name: 'world' };
448+
static defaultProps: Partial<Props> = { name: 'world' };
449449
}
450450

451451
// Type-checks! No type assertions needed!

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy