From dbbd63b0a21bbaf00ca6f51aa9d83a77d0e40bbf Mon Sep 17 00:00:00 2001 From: Jed Watson Date: Wed, 1 Feb 2017 01:00:03 +1100 Subject: [PATCH] Clarifying comment for defaultChildren --- src/Creatable.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Creatable.js b/src/Creatable.js index 55cf75075b..145c568aa3 100644 --- a/src/Creatable.js +++ b/src/Creatable.js @@ -212,10 +212,9 @@ const Creatable = React.createClass({ let { children } = this.props; - // XXX: We can't use destructuring default values to set this, because if - // we're passed null for our 'children' prop, the default value will not be - // used as babel compiles destructuring default values to: - // value === undefined ? defaultValue : value + // We can't use destructuring default values to set the children, + // because it won't apply work if `children` is null. A falsy check is + // more reliable in real world use-cases. if (!children) { children = defaultChildren; }