Skip to content

Commit 973a212

Browse files
committed
Merge pull request #103 from VanTanev/improve-default-props-example
[Basic] Improve the class component defaultProps example
2 parents fc22723 + 4492172 commit 973a212

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

+1-1
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)