react-conditional-component
Advanced tools
Comparing version 0.1.1 to 0.1.2
{ | ||
"name": "react-conditional-component", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "This component displays its children only if they satisfy their predicate", | ||
@@ -5,0 +5,0 @@ "main": "react-conditional-component.jsx", |
@@ -7,3 +7,4 @@ var React = require('react'); | ||
var shown = []; | ||
this.props.children.forEach(function(child) { | ||
var children = this.props.children instanceof Array ? this.props.children : [this.props.children]; | ||
children.forEach(function(child) { | ||
var show = true; | ||
@@ -10,0 +11,0 @@ if (show && child.props.showIfDefined) { |
Sorry, the diff of this file is not supported yet
20688
50