1.0.0 • Published 4 years ago

@ej-hooks/use-notification v1.0.0

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

@ej-hooks/use-notification

React Hook to configure and display notification to user.

Installation

yarn

yarn add @ej-hooks/use-notification

npm

npm i @ej-hooks/use-notification

Usage

import React from 'react';
import useNotification from '@ej-hooks/use-notification';
function App() {
  const triggerNotif = useNotification('title of notification', {
    body: 'body of notification',
  });
  return <button onClick={triggerNotif}>Hello</button>;
}

Arguments

ArgumentTypeDescriptionRequired
titlestringTitle of notificationyes
optionsobjectAn object containing the options of notificationno

want to know about the options?