From 6c75c26970b2f4f58bdf947e379f487bcf660845 Mon Sep 17 00:00:00 2001 From: Jonathan Lehman Date: Mon, 28 Mar 2016 10:18:27 -0400 Subject: [PATCH] Use API to examine number of children - Prevents breaking if the internal structure of props.children changes in the future --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 14e984c..bd9521a 100644 --- a/src/index.js +++ b/src/index.js @@ -95,7 +95,7 @@ var mq = React.createClass({ return null; } var props = omit(this.props, excludedPropKeys); - if (this.props.component || this.props.children.length > 1) { + if (this.props.component || React.Children.count(this.props.children) > 1) { return React.createElement( this.props.component || 'div', props,