0.3.2 • Published 5 years ago
use-browser-notifications v0.3.2
use-browser-notifications
Made with create-react-library
Install
$ npm install --save use-browser-notificationsOr using Yarn with
$ yarn add use-browser-notificationsUsage
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 Yarn
$ yarnThen run the start script
$ yarn startLicense
MIT © andreasonny83