use-browser-notifications

Made with create-react-library

NPM JavaScript Style Guide

Install

$ npm install --save use-browser-notifications

Or using Yarn with

$ yarn add use-browser-notifications

Usage

import React from 'react'

import { useBrowserNotifications } from 'use-browser-notifications';

function App() {
  const { show } = useBrowserNotifications({
    title: 'test notification',
    body: 'Hello world!',
  });

  return (
    <div className="App">
      <header className="App-header">
        <p>
          Use Browser Notifications
        </p>

        <div className="buttons">
          <button className="button" onClick={show}>Show Notification</button>
        </div>
      </header>
    </div>
  );
}

export default App;

Local development

First install all the node dependencies using npm

$ npm install

Then run the start script

$ npm start

License

MIT © andreasonny83