Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mergeInto removed and window checked #9

Merged
merged 2 commits into from
Feb 9, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var assign = require('object-assign');
var omit = require('lodash.omit');
var mediaQuery = require('./mediaQuery');
var toQuery = require('./toQuery');
var matchMedia = window ? window.matchMedia : null;
var matchMedia = typeof window != 'undefined' ? window.matchMedia : null;

var defaultTypes = {
component: React.PropTypes.func,
Expand Down Expand Up @@ -79,4 +79,4 @@ var mq = React.createClass({
}
});

module.exports = mq;
module.exports = mq;
8 changes: 4 additions & 4 deletions src/mediaQuery.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var PropTypes = require('react/lib/ReactPropTypes');
var mergeInto = require('react/lib/mergeInto');
var assign = require('object-assign');

var stringOrNumber = PropTypes.oneOfType([
PropTypes.string,
Expand Down Expand Up @@ -71,11 +71,11 @@ var types = {
};

var all = {};
mergeInto(all, types);
mergeInto(all, features);
assign(all, types);
assign(all, features);

module.exports = {
all: all,
types: types,
features: features
};
};