Files
react-test/docs/data/material/getting-started/templates/crud-dashboard/hooks/useNotifications/useNotifications.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

11 lines
351 B
JavaScript
Raw Normal View History

2025-12-12 14:26:25 +09:00
import * as React from 'react';
import NotificationsContext from './NotificationsContext';
export default function useNotifications() {
const notificationsContext = React.useContext(NotificationsContext);
if (!notificationsContext) {
throw new Error('Notifications context was used without a provider.');
}
return notificationsContext;
}