Skip to content

Commit

Permalink
Merge pull request #103 from VanTanev/improve-default-props-example
Browse files Browse the repository at this point in the history
[Basic] Improve the class component defaultProps example
  • Loading branch information
swyxio authored Apr 8, 2019
2 parents 18009b2 + 6a467f6 commit 623a1d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ export class Greet extends React.Component<Props> {
const { name } = this.props;
return <div>Hello ${name.toUpperCase()}!</div>;
}
static defaultProps = { name: 'world' };
static defaultProps: Partial<Props> = { name: 'world' };
}

// Type-checks! No type assertions needed!
Expand Down

0 comments on commit 623a1d0

Please sign in to comment.