# hook-usewindowwidth

> A react hook to get access to the current width of the browser window.

Latest version **0.0.3** (published 2019-04-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install hook-usewindowwidth
pnpm add hook-usewindowwidth
yarn add hook-usewindowwidth
bun add hook-usewindowwidth
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2019-04-17 |
| First published | 2019-04-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 11.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Manuel Penaloza |
| Maintainers | manpenaloza |

## Links

- npm: https://www.npmjs.com/package/hook-usewindowwidth
- Repository: https://github.com/blue-tomato/useWindowWidth
- Homepage: https://github.com/blue-tomato/useWindowWidth#readme
- Issues: https://github.com/blue-tomato/useWindowWidth/issues
- npm.io page: https://npm.io/package/hook-usewindowwidth

## Dependencies (1)

- [react](https://npm.io/package/react.md) ^16.8.6

## Recent versions

- 0.0.3 (latest) — 2019-04-17
- 0.0.2 — 2019-04-11
- 0.0.1 — 2019-04-11

## README

This react hook exposes the current window width to our react component. It also considers window resizing.

## Installation

```markdown
npm install hook-usewindowwidth
```

## Example

```javascript
import React from 'react';
import ReactDOM from 'react-dom';
import useWindowWidth from 'hook-usewindowwidth';

const DisplayWindowWidth = () => {
    const windowWidth = useWindowWidth();
    return (
      <p>The current window width is {windowWidth}</p>
    )
}

ReactDOM.render(<DisplayWindowWidth />, rootElement);
```

## Requirements
This hook requires `React 16.8.0` or higher. As a result `React 16.8.0` is also a peer dependency of this package.

---
_Source: https://npm.io/package/hook-usewindowwidth · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
