From d96fa05c6c0e23e53a034f242c4e5d1de5974861 Mon Sep 17 00:00:00 2001 From: Jinxiu Date: Tue, 8 Mar 2016 11:23:18 +0800 Subject: [PATCH] Missed parentheses for matchMeida parameter https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia --- docs/12-context.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/12-context.md b/docs/12-context.md index 4c647365..d85d7c2f 100644 --- a/docs/12-context.md +++ b/docs/12-context.md @@ -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}); }