Skip to content

Prasiddha22/react-window-size

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@prasiddha/react-window-size

@prasiddha/react-window-size provides with a useWindowSize hook.

GIF showing the basic working of react-debounced-hook

Installation

Use the package manager npm to install react-simple-spoiler.

npm install @prasiddha/react-window-size --save

Usage

import { useWindowSize } from '@prasiddha/react-window-size';

const App = () => {
  const { width, height } = useWindowSize();
  return (
    <div
      style={{
        height: '100vh',
        width: '100vw',
        display: 'flex',
        justifyContent: 'center',
        alignItems: 'center',
      }}
    >
      <div>
        <h1>Height:{height}</h1>
        <h1>Width:{width}</h1>
      </div>
    </div>
  );
};

export default App;

export default App;

Props

--

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

About

Get window height and width upon window resize

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published