11# React Window Hooks
22
3- [ ![ NPM] ( https://img.shields.io/npm/v/@better-typed/react- window-hooks .svg )] ( https://www.npmjs.com/package/@better-typed/react- window-hooks )
4- ![ npm bundle size] ( https://img.shields.io/bundlephobia/minzip/@better-typed/react- window-hooks )
5- ![ npm type definitions] ( https://img.shields.io/npm/types/@better-typed/react- window-hooks )
6- ![ NPM] ( https://img.shields.io/npm/l/@better-typed/react- window-hooks )
7- ![ npm] ( https://img.shields.io/npm/dm/@better-typed/react- window-hooks )
3+ [ ![ NPM] ( https://img.shields.io/npm/v/@better-hooks/ window.svg )] ( https://www.npmjs.com/package/@better-hooks/ window )
4+ ![ npm bundle size] ( https://img.shields.io/bundlephobia/minzip/@better-hooks/ window )
5+ ![ npm type definitions] ( https://img.shields.io/npm/types/@better-hooks/ window )
6+ ![ NPM] ( https://img.shields.io/npm/l/@better-hooks/ window )
7+ ![ npm] ( https://img.shields.io/npm/dm/@better-hooks/ window )
88![ GitHub stars] ( https://img.shields.io/github/stars/BetterTyped/react-window-hooks?style=social )
99
1010> Handle window events and observe window size
2020## Install
2121
2222``` bash
23- npm install --save @better-typed/react- window-hooks
23+ npm install --save @better-hooks/ window
2424```
2525
2626or
2727
2828``` bash
29- yarn add @better-typed/react- window-hooks
29+ yarn add @better-hooks/ window
3030```
3131
3232## useWindowEvent
3333
3434``` tsx
3535import React from " react" ;
36- import { useWindowEvent } from " @better-typed/react- window-hooks " ;
36+ import { useWindowEvent } from " @better-hooks/ window" ;
3737
3838const MyComponent: React .FC = () => {
3939 // Unmounts event with component lifecycle
@@ -50,7 +50,7 @@ const MyComponent: React.FC = () => {
5050
5151``` tsx
5252import React from " react" ;
53- import { useWindowEvent } from " @better-typed/react- window-hooks " ;
53+ import { useWindowEvent } from " @better-hooks/ window" ;
5454
5555const MyComponent: React .FC = () => {
5656 // Unmounts event with component lifecycle
@@ -69,7 +69,7 @@ const MyComponent: React.FC = () => {
6969
7070``` tsx
7171import React from " react" ;
72- import { useWindowSize } from " @better-typed/react- window-hooks " ;
72+ import { useWindowSize } from " @better-hooks/ window" ;
7373
7474const MyComponent: React .FC = () => {
7575 // Updates with resizing
0 commit comments