Narcissistic Preening Monarch

    This package has been deprecated

    Author message:

    This project has reached the end of its development. Please use builtin solution https://www.npmjs.com/package/react-responsive\#server-side-rendering

    react-responsive-ssr
    TypeScript icon, indicating that this package has built-in type declarations

    0.4.1 • Public • Published

    [DEPRECATED]

    This project has reached the end of its development. Please use builtin solution eact-responsive#server-side-rendering.

    React Responsive SSR

    // TODO

    Install

    Note: react-responsive-ssr has a peer dependency to react, react-dom, prop-types, react-responsive and mobile-detect, so don't forget to install those packages.

    npm install --save react react-dom prop-types react-responsive mobile-detect react-responsive-ssr
    yarn add react react-dom prop-types react-responsive mobile-detect react-responsive-ssr

    Usage

    With Next.js:

    import { ResponsiveProvider, Responsive } from 'react-responsive-ssr';
     
    class App extends React.Component<any, any> {
      public static async getInitialProps(context: INextContext): Promise<any> {
        let responsive: Responsive;
     
        if (context.req) {
          responsive = new Responsive(context.req);
        }
     
        return {
          responsive,
        }
      }
     
      public render() {
        return (
          <ResponsiveProvider value={this.props.responsive}>
            // ...
          </ResponsiveProvider>
        );
      }
    }

    In component:

    import { MediaQuerySSR } from 'react-responsive-ssr';
     
    // ...
      public render() {
        // ...
        return (
          <MediaQuerySSR maxWidth={991}>
            // ...
          </MediaQuerySSR>
        );
      }
    // ...

    Concepts

    // TODO

    License

    The MIT License

    Credits

    react-responsive-ssr is maintained and sponsored by Infinum.

    Keywords

    none

    Install

    npm i react-responsive-ssr

    DownloadsWeekly Downloads

    168

    Version

    0.4.1

    License

    MIT

    Unpacked Size

    138 kB

    Total Files

    17

    Last publish

    Collaborators

    • infinumcom
    • buhin
    • adrianbicanic
    • ivicabatinic