MCPcopy
hub / github.com/marmelab/react-admin / useNotify

Function useNotify

packages/ra-core/src/notification/useNotify.ts:21–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19 * notify('Post renamed', { type: 'info', undoable: true })
20 */
21export const useNotify = () => {
22 const addNotification = useAddNotificationContext();
23 return useCallback(
24 (
25 message: string | ReactNode,
26 options: NotificationOptions & { type?: NotificationType } = {}
27 ) => {
28 const { type: messageType = 'info', ...notificationOptions } =
29 options;
30 addNotification({
31 message,
32 type: messageType,
33 notificationOptions,
34 });
35 },
36 [addNotification]
37 );
38};

Callers 15

EmptyStockButtonFunction · 0.90
BasicNotificationFunction · 0.90
TypeNotificationFunction · 0.90
MultilineNotificationFunction · 0.90
LineBreakNotificationFunction · 0.90
NoAutoHideNotificationFunction · 0.90
UndoableNotificationFunction · 0.90
MessageArgsNotificationFunction · 0.90
AnchorOriginNotificationFunction · 0.90
CustomNodeNotificationFunction · 0.90

Calls 1

Tested by 1

NotifyFunction · 0.72