Skip to content

Commit 2c0da30

Browse files
author
Kaka
authored
Fix the example of "propTypes"
This example makes me confused. I guess it missed the use of "children" of good code. Is the example to explain that you should specify default values for non-required props? Thanks
1 parent 54be49a commit 2c0da30

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

react/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,8 @@
360360
};
361361
362362
// good
363-
function SFC({ foo, bar }) {
364-
return <div>{foo}{bar}</div>;
363+
function SFC({ foo, bar, children }) {
364+
return <div>{foo}{bar}{children}</div>;
365365
}
366366
SFC.propTypes = {
367367
foo: PropTypes.number.isRequired,

0 commit comments

Comments
 (0)