Jinxiu 9 years ago
parent
commit
d96fa05c6c
  1. 2
      docs/12-context.md

2
docs/12-context.md

@ -177,7 +177,7 @@ var MediaQuery = React.createClass({
}, },
componentDidMount: function(){ componentDidMount: function(){
var checkMediaQuery = 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){ if (type !== this.state.type){
this.setState({type:type}); this.setState({type:type});
} }

Loading…
Cancel
Save