Socket
Socket
Sign inDemoInstall

react-responsive

Package Overview
Dependencies
23
Maintainers
2
Versions
70
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.4 to 1.1.5

2

package.json
{
"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() {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc