JSPM

react-width-checker

1.0.14
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q35653F
  • License MIT

React window width checker with ssr support.

Package Exports

  • react-width-checker

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-width-checker) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Width checker

Instalation

yarn add react-width-checker

or

npm install react-width-checker

Usage

import { WidthChecker } from 'react-width-checker';
<WidthChecker widthUp={650} widthBelow={1200}>
  {({ display }) =>
    display && <p>Something you want to show between 650px and 1200px of screen wide</p>
  }
</WidthChecker>

Props

  • wait - (default 200) time in miliseconds to wait between each debounce tick
  • widthUp - (number) bottom range
  • widthBelow - (number) upper range
  • ssr - (optional, boolean) if you want to render component on server set it to true