1.0.3 • Published 3 years ago

@ib-hooks/use-notification v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@ib-hooks/use-notification

React Hook to use browser notification easier.

Installation

yarn

yarn add @ib-hooks/use-notification

npm

npm i @ib-hooks/use-notification

Usage

import React from "react";
import useNotification from "@ib-hooks/use-notification";

function App() {
  const sendNotification = useNotification("Hello!");

  return <button onClick={sendNotification}>Send Hello</button>;
}

Arguments

ArgumentTypeDescriptionRequired
titlestringThe text you want to notice.yes
optionsobjectReferenceno

Return

Return valueTypeDescription
FunctionsobjectIf a user grants a permission, notification can be send using this function.