Skip to main content
Version: 1.0.4

NotificationCenterProvider

@spartanfx/react v1.0.4


@spartanfx/react / NotificationCenterProvider

Variable: NotificationCenterProvider

const NotificationCenterProvider: 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>
);
};