An open API service indexing awesome lists of open source software.

https://github.com/alexweblab/window-width-react-hook

This React hook returns the current window width.
https://github.com/alexweblab/window-width-react-hook

Last synced: 11 months ago
JSON representation

This React hook returns the current window width.

Awesome Lists containing this project

README

          

# About

This React hook returns the current window width.

## Install

```bash
npm i window-width-react-hook
```

Or

```bash
yarn add window-width-react-hook
```

## Usage

1. Include the hook:

```javascript
import useWindowWidth from 'window-width-react-hook';
```

2. Use it where is needed:

```jsx
function App() {
return (


Current width: {useWindowWidth()}px

);
}
```

### License

Licensed under the MIT License, Copyright © 2021 AlexWebLab