Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 622 Bytes

File metadata and controls

31 lines (22 loc) · 622 Bytes

🔔useNotification

Uses the Notification Browser API in hook form

Arguments

Returns

  • fireNotify: Function(): Asks the user to allow notifications

Usage

import { useNotification } from 'react-recipes';

const App = () => {
  const triggerNotif = useNotification('hello world', {
    dir: 'rtl',
    body: 'Nice!',
  });

  return (
    <div className="App">
      <button onClick={triggerNotif}>Hello</button>
    </div>
  );
};