diff --git a/content/docs/typechecking-with-proptypes.md b/content/docs/typechecking-with-proptypes.md index 6dc978a0b..1a1aa4a71 100644 --- a/content/docs/typechecking-with-proptypes.md +++ b/content/docs/typechecking-with-proptypes.md @@ -147,7 +147,7 @@ MyComponent.propTypes = { You can define default values for your `props` by assigning to the special `defaultProps` property: -``` +```javascript const defaultProps = { name: 'Stranger' }; @@ -172,7 +172,7 @@ ReactDOM.render( You can also put propTypes and defaultProps as static props inside React class. -``` +```javascript class Greeting extends Component { static defaultProps = {