NotificationCenterProvider
@spartanfx/react / NotificationCenterProvider
Variable: NotificationCenterProvider
constNotificationCenterProvider:React.FC<INotificationCenterProviderProps>
NotificationCenter Provider component Wraps the app to provide notification API access throughout the component tree
Example
// With localStorage
const MyApp = () => {
const config = useNotificationCenter({
storage: 'local',
storageKey: 'my-app-notifications',
maxItems: 100,
});
return (
<NotificationCenterProvider config={config}>
<App />
</NotificationCenterProvider>
);
};
// With SharePoint
const MyApp = () => {
const config = useSharePointNotificationCenter({
context: spContext,
listTitle: 'Notifications',
});
return (
<NotificationCenterProvider config={config}>
<App />
</NotificationCenterProvider>
);
};