npm.io
1.0.1 • Published 6 years ago

use-window-resize-value

Licence
MIT
Version
1.0.1
Deps
0
Size
581 kB
Vulns
0
Weekly
0

use-window-resize-value

A simple React hook that returns the pixel value of the window width on resize.

NPM JavaScript Style Guide

Install

npm install --save use-window-resize-value

Usage

import React from 'react'
import { useWindowResizeValue } from 'use-window-resize-value'

const App = () => {
  const windowWidth = useWindowResizeValue()
  return <h1>The current width of the window is: {windowWidth}px</h1>
}

export default App

License

MIT TheLeePriest


This hook is created using create-react-hook.