From 20671433f03e3dcb8c6971aa98cf9583cde1a198 Mon Sep 17 00:00:00 2001 From: eric thul Date: Thu, 24 Sep 2015 17:26:11 -0400 Subject: [PATCH] Ensure getChildren returns an array Resolves #44 --- src/React.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/React.js b/src/React.js index ad620db..61bea49 100644 --- a/src/React.js +++ b/src/React.js @@ -17,7 +17,15 @@ exports.getRefs = function(ctx) { exports.getChildren = function(ctx) { return function() { - return ctx.props.children; + var children = ctx.props.children; + + var result = []; + + React.Children.forEach(children, function(child){ + result.push(child); + }); + + return result; }; };