UNPKG

@magicbell/react-headless

Version:

Hooks to build a notification inbox

19 lines (18 loc) 648 B
export interface Props { children: (params: { createSubscription: () => Promise<unknown>; isPushAPISupported: boolean; }) => JSX.Element; serviceWorkerPath?: string; skipServiceWorkerRegistration?: boolean; } /** * Headless component to create subscriptions to web push notifications. * * @example * <WebPushNotificationsSubscriber> * {({ createSubscription }) => * <button onClick={createSubscription}>Subscribe</button>} * <WebPushNotificationsSubscriber> */ export default function WebPushNotificationsSubscriber({ children, serviceWorkerPath, skipServiceWorkerRegistration, }: Props): JSX.Element;