Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

React hook for subscribing to window size

License

NotificationsYou must be signed in to change notification settings

rehooks/window-size

Repository files navigation

React hook for subscribing to window size

Note: This is using the newReact Hooks API Proposalwhich is subject to change until React 16.7 final.

You'll need to installreact,react-dom, etc at^16.7.0-alpha.0

Install

yarn add @rehooks/window-size

Usage

importuseWindowSizefrom'@rehooks/window-size';functionMyComponent(){letwindowSize=useWindowSize();// {//   innerWidth: window.innerWidth,//   innerHeight: window.innerHeight,//   outerWidth: window.outerWidth,//   outerHeight: window.outerHeight,// }// ...}

About

React hook for subscribing to window size

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp