@jdthornton/screenwidth
TypeScript icon, indicating that this package has built-in type declarations

1.0.8 • Public • Published

@jdthornton/screenwidth

npm (scoped) npm bundle size (minified)

React screen width context and hooks.

Install

$ npm install @jdthornton/screenwidth

Usage

import ScreenWidthProvider, { withIsMobile } from "@jdthornton/screenwidth";

const HelloWorld = withIsMobile(({
  isMobile
}) => (
  <div>
    Hello {isMobile ? "Mobile" : "Desktop"} World!
  </div>
), 1024)

function App(){
  return(
    <ScreenWidthProvider>
      <HelloWorld />
    </ScreenWidthProvider>
  )
}

Readme

Keywords

none

Package Sidebar

Install

npm i @jdthornton/screenwidth

Weekly Downloads

2

Version

1.0.8

License

MIT

Unpacked Size

5.11 kB

Total Files

5

Last publish

Collaborators

  • jdthornton