Socket
Socket
Sign inDemoInstall

use-window-focus

Package Overview
Dependencies
0
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    use-window-focus

React Hook to show if window is focused or not


Version published
Weekly downloads
6.3K
decreased by-1.25%
Maintainers
1
Install size
12.1 kB
Created
Weekly downloads
 

Readme

Source

use-window-focus

React Hook to show if window is focused or not

Installation

yarn add use-window-focus

Usage

import React from 'react';
import useWindowFocus from 'use-window-focus';

export default () => {
  const windowFocused = useWindowFocus();

  return (
    <div>
      <span>{windowFocused ? 'Focused' : 'Not focused'}</span>
    </div>
  );
}

License

The package is available as open source under the terms of the MIT License.

Keywords

FAQs

Last updated on 03 Mar 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc