1.3.1 • Published 5 years ago

@21kb/react-notification-hook v1.3.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

@21kb/react-notification-hook

React hook to use the Notifications API

Install

npm

npm install --save @21kb/react-notification-hook

Yarn

yarn add @21kb/react-notification-hook

Usage

import useNotification from '@21kb/react-notification-hook';

const Component = () => {
  const notify = useNotification({
    title: '💡 Test notification!',
    options: {
      dir: 'rtl',
    }
  });

  return (
    <button onClick={notify()}>Notify me!</button>
  );
};

NOTE: useNotification assumes the user has already granted permissions.

License

MIT

1.3.1

5 years ago

1.3.0

6 years ago

1.2.0

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago