conventional-blackC
Refine2y ago
13 replies
conventional-black

Notification provider customization with toast syntax error.

copied straight from the documentation.
i get an error in this file.
11 │ progress: undoableTimeout && (undoableTimeout / 10) * 2,
12 │ render: (
13 <UndoableNotification
14 │ message={message}
·
15 │ cancelMutation={cancelMutation}
16 />
17 ),



Caused by:
Syntax Error

this is notificationProvider.ts file.

https://refine.dev/docs/notification/notification-provider/#close


const notificationProvider: NotificationProvider = {
open: ({ message, key, type }) => {
if (toast.isActive(key)) {
toast.update(key, {
render: message,
type,
});
} else {
toast(message, {
toastId: key,
type,
});
}
},
};
when i set my notificationProvider.ts like this it works. but with undoable notification it didnt work. i built the component as described in documentation. code was too long therefore i was not able
copy paste it.
Refine let's you set a notification API by providing the notificationProvider property to the `` component.
Notification Provider | Refine
Was this page helpful?