mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 12:13:11 +00:00
Missed parentheses for matchMeida parameter
https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia
This commit is contained in:
@@ -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});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user