mirror of
https://github.com/airbnb/javascript.git
synced 2026-04-25 03:00:19 -04:00
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
This commit is contained in:
@@ -360,8 +360,8 @@
|
||||
};
|
||||
|
||||
// good
|
||||
function SFC({ foo, bar }) {
|
||||
return <div>{foo}{bar}</div>;
|
||||
function SFC({ foo, bar, children }) {
|
||||
return <div>{foo}{bar}{children}</div>;
|
||||
}
|
||||
SFC.propTypes = {
|
||||
foo: PropTypes.number.isRequired,
|
||||
|
||||
Reference in New Issue
Block a user