Skip to content

Commit 6891b2e

Browse files
committed
Merge pull request #45 from ethul/topic/issue-44
Ensure getChildren returns an array
2 parents 97bae39 + 2067143 commit 6891b2e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/React.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,15 @@ exports.getRefs = function(ctx) {
1717

1818
exports.getChildren = function(ctx) {
1919
return function() {
20-
return ctx.props.children;
20+
var children = ctx.props.children;
21+
22+
var result = [];
23+
24+
React.Children.forEach(children, function(child){
25+
result.push(child);
26+
});
27+
28+
return result;
2129
};
2230
};
2331

0 commit comments

Comments
 (0)