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:
Kaka
2017-04-12 16:43:12 +08:00
committed by GitHub
parent 54be49ab7d
commit 2c0da30904

View File

@@ -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,