Nighttime Peanut Migrations

    react-responsive-hoc

    1.0.0 • Public • Published

    react-responsive-hoc

    Build Status NPM version

    Wrapper around react-responsive to work with SSR.

    This module exports a provider for defining the default device (for SSR) and a modified MediaQuery from react-responsive to use the default device.

    Installation

    $ yarn add react-responsive-hoc
    

    Usage

    import { MediaQueryProvider, MediaQuery } from 'react-responsive-hoc';
     
    const Example = () => {
        return (
            <MediaQuery query="(min-device-width: 1224px)">
                On Desktop only
            </MediaQuery>
        )
    };
     
    const App = () => {
        return (
            <MediaQueryProvider width={1600} height={800}>
                <Example />
            </MediaQueryProvider>
        );
    }

    Install

    npm i react-responsive-hoc

    DownloadsWeekly Downloads

    13

    Version

    1.0.0

    License

    Apache-2.0

    Last publish

    Collaborators

    • samypesse