0.2.6 • Published 4 years ago

@hmn/use-window-size v0.2.6

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
4 years ago

@hmn/use-window-size

A hook that provides information of the dimensions of the window

Installation

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

Importing the hook

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

Usage

const Demo = () => {
    const { innerWidth, innerHeight, outerHeight, outerWidth } = useWindowSize()

    return (
        <>
            <h1>Window dimensions</h1>
            <h3>Resize window to see changes</h3>
            <div>
                <div>innerWidth: {innerWidth}</div>
                <div>innerHeight: {innerHeight}</div>
                <div>outerWidth: {outerWidth}</div>
                <div>outerHeight: {outerHeight}</div>
            </div>
        </>
    )
}

render(<Demo/>)
0.2.6

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.3

5 years ago