react-responsive
Advanced tools
Comparing version 1.1.4 to 1.1.5
{ | ||
"name": "react-responsive", | ||
"description": "Media queries in react for responsive design", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"homepage": "http://github.com/wearefractal/react-responsive", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -54,3 +54,3 @@ # react-responsive [![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Support us][gittip-image]][gittip-url] | ||
</MediaQuery> | ||
<MediaQuery query='(orientation: landscape)'> | ||
<MediaQuery query='(orientation: landscape)'> | ||
<div>You are landscape</div> | ||
@@ -101,3 +101,3 @@ </MediaQuery> | ||
</MediaQuery> | ||
<MediaQuery orientation='landscape'> | ||
<MediaQuery orientation='landscape'> | ||
<div>You are landscape</div> | ||
@@ -196,3 +196,3 @@ </MediaQuery> | ||
</MediaQuery> | ||
<MediaQuery orientation='landscape'> | ||
<MediaQuery orientation='landscape'> | ||
<div>You are landscape</div> | ||
@@ -199,0 +199,0 @@ </MediaQuery> |
@@ -99,4 +99,5 @@ 'use strict'; | ||
var hasMergeProps = Object.keys(props).length > 0; | ||
var childrenCount = React.Children.count(this.props.children); | ||
var wrapChildren = this.props.component || | ||
React.Children.count(this.props.children) > 1 || | ||
childrenCount > 1 || | ||
typeof this.props.children === 'string' || | ||
@@ -115,5 +116,8 @@ this.props.children === undefined; | ||
); | ||
} else { | ||
} else if (childrenCount){ | ||
return this.props.children; | ||
} | ||
else { | ||
return null; | ||
} | ||
} | ||
@@ -120,0 +124,0 @@ }); |
@@ -109,2 +109,13 @@ var React = require('react'); | ||
}); | ||
it('renders nothing when children is an empty array', function() { | ||
const mq = ( | ||
<MediaQuery query="all"> | ||
{[].map((content, index) => { | ||
return <div key={index}>{content}</div> | ||
})} | ||
</MediaQuery> | ||
); | ||
const e = TestUtils.renderIntoDocument(mq); | ||
assert.equal(e.render(), null); | ||
}); | ||
}); | ||
@@ -111,0 +122,0 @@ it('renders nothing when no matches', function() { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
604656
7649
1