From 2c0da30904d842e80d2b7d0404a65867ba19b6df Mon Sep 17 00:00:00 2001 From: Kaka Date: Wed, 12 Apr 2017 16:43:12 +0800 Subject: [PATCH] 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 --- react/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/react/README.md b/react/README.md index 4f31fc21..ce6bbbd7 100644 --- a/react/README.md +++ b/react/README.md @@ -360,8 +360,8 @@ }; // good - function SFC({ foo, bar }) { - return
{foo}{bar}
; + function SFC({ foo, bar, children }) { + return
{foo}{bar}{children}
; } SFC.propTypes = { foo: PropTypes.number.isRequired,