Last active
June 14, 2018 17:45
-
-
Save icyJoseph/d144aab11218667f511f7bc52ce60d5f to your computer and use it in GitHub Desktop.
Responsive React Function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import Media from 'react-media'; | |
const Responsive = () => ( | |
<Media query={{ maxWidth: 1023 }}> | |
{ | |
matches => | |
matches | |
? <div>Less than 1023</div> | |
: <div>More than 1023</div> | |
} | |
</Media> | |
); | |
export default Responsive; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment