Skip to content

Commit 3515be7

Browse files
authored
Fix example
1 parent 60196fc commit 3515be7

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
@@ -137,7 +137,7 @@ import PropTypes from 'prop-types';
137137
* General component description.
138138
*/
139139
class MyComponent extends Component {
140-
render: function() {
140+
render() {
141141
// ...
142142
}
143143
}
@@ -146,7 +146,7 @@ MyComponent.propTypes = {
146146
/**
147147
* Description of prop "foo".
148148
*/
149-
foo: PropTypes.number,
149+
foo: PropTypes.number.isRequired,
150150
/**
151151
* Description of prop "bar" (a custom validation function).
152152
*/
@@ -176,7 +176,7 @@ we are getting this output:
176176
"type": {
177177
"name": "number"
178178
},
179-
"required": false,
179+
"required": true,
180180
"description": "Description of prop \"foo\".",
181181
"defaultValue": {
182182
"value": "42",

0 commit comments

Comments
 (0)