Closed erwagasore closed 9 years ago
Is there a way to check if the match happened so that I can decide which media query I can use to set the state?
I found a solution in your other lib. react-slick (https://github.com/akiran/react-slick/blob/master/lib/slider.jsx#L20-L33)
Here is how it looks in mine
Object.keys(mediaQueries).forEach(function(key) {
this.media(mediaQueries[key], function() {
this.setState({media: key});
}.bind(this));
}.bind(this));
I have all media queries in an object which I get from a property
Calling Logo
`var mQueries = {'phone': {maxWidth: 414}, 'tablet': {minWidth: 870}, 'desktop': {minWidth: 1084}};