@ziphooks/use-before-top

1.0.0 • Public • Published

@ziphooks/use-before-top

React Hook for detecting if mouse is located at browser's top bar. You can use this React Hook for prevent exiting without saving.

Installation

yarn

yarn add @ziphooks/use-before-top

npm

npm i @ziphooks/use-before-top

Usage

import React from "react";
import useBeforeTop from "@ziphooks/use-before-top";

function App() {
  useBeforeTop(() => alert("Are you saved some stuffs?"));
  return <h1>Some Stuffs</h1>;
};

Arguments

Argument Type Description required
onBefore Boolean A boolean that means if requesting API is over true

Package Sidebar

Install

npm i @ziphooks/use-before-top

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

1.94 kB

Total Files

4

Last publish

Collaborators

  • zipperdev