0.1.1 • Published 11 months ago

@talves/use-window-size v0.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
11 months ago

Installation

This module is distributed via npm which is bundled with node and should be installed as one of your project's dependencies:

npm install --save @talves/use-window-size

OR

yarn add @talves/use-window-size

Usage

/* using react ^17.0.1 */
import { useEffect } form 'react'
import { useWindowSize } from '@talves/use-window-size'

import useWindowSize from '@talves/use-window-size'

function ourFunctionalComponent({ ...props }) {
  const size = useWindowSize()

  React.useEffect(() => {
    // Do something with the size
  }, [size])

  ...
}

NOTE: This is a module package library for react using window. The choice is to resolve the import to lib/index.mjs. There is a commonjs version in dist/lib/use-window-size.js if someone needed.

Other Solutions

Plenty of other hooks out there.

0.1.1

11 months ago

0.1.0

11 months ago

0.0.2

2 years ago

0.0.1

2 years ago