Missed parentheses for matchMeida parameter

https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia
This commit is contained in:
Jinxiu
2016-03-08 11:23:18 +08:00
parent 614884e1cb
commit d96fa05c6c

View File

@@ -177,7 +177,7 @@ var MediaQuery = React.createClass({
},
componentDidMount: function(){
var checkMediaQuery = function(){
var type = window.matchMedia("min-width: 1025px").matches ? 'desktop' : 'mobile';
var type = window.matchMedia("(min-width: 1025px)").matches ? 'desktop' : 'mobile';
if (type !== this.state.type){
this.setState({type:type});
}