window-width-react-hook
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

About

This React hook returns the current window width.

Install

npm i window-width-react-hook

Or

yarn add window-width-react-hook

Usage

  1. Include the hook:

    import useWindowWidth from 'window-width-react-hook';
  2. Use it where is needed:

    function App() {
     return (
       <div>
         Current width: {useWindowWidth()}px
       </div>
     );
    }

License

Licensed under the MIT License, Copyright © 2021 AlexWebLab

Readme

Keywords

Package Sidebar

Install

npm i window-width-react-hook

Weekly Downloads

0

Version

1.2.1

License

MIT

Unpacked Size

2.01 kB

Total Files

4

Last publish

Collaborators

  • alexweblab