Skip to content

Instantly share code, notes, and snippets.

@icyJoseph
Last active June 14, 2018 17:45
Show Gist options
  • Save icyJoseph/d144aab11218667f511f7bc52ce60d5f to your computer and use it in GitHub Desktop.
Save icyJoseph/d144aab11218667f511f7bc52ce60d5f to your computer and use it in GitHub Desktop.
Responsive React Function
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