useSharePointNotificationCenter
@spartanfx/react / useSharePointNotificationCenter
Function: useSharePointNotificationCenter()
useSharePointNotificationCenter(
options?):INotificationCenterHook
Hook for managing notifications with SharePoint list backing
Can be used in two ways:
- With config: Creates a new SharePoint instance
- Without config: Accesses the notification center from context
Parameters
options?
Returns
Example
// Create instance (at app root)
import { getSP } from '@spartanfx/react';
const sp = getSP(this.context);
const config = useSharePointNotificationCenter({
sp: sp,
listTitle: 'Notifications',
schema: { id: 'Id', title: 'Title', ... }
});
<NotificationCenterProvider config={config}>...</NotificationCenterProvider>
// Access from context (in child components)
const { addNotification, items } = useSharePointNotificationCenter();