@ej-hooks/use-notification

1.0.0 • Public • Published

@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

Argument Type Description Required
title string Title of notification yes
options object An object containing the options of notification no

want to know about the options?

Package Sidebar

Install

npm i @ej-hooks/use-notification

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

2.17 kB

Total Files

4

Last publish

Collaborators

  • eunjinfizz