How can I custom resource name in Notification when create or delete success
Hi guys. I want to change default resource name in Notification when create or delete success.
3 Replies
Hey @Junior Chen! I'm the kapa.ai support bot. I've searched through the docs to try to answer your question. :wave:
----------------------
You can customize the success notification for both
create
and delete
actions by using the successNotification
prop in the useCreate
and useDelete
hooks. You can provide a custom message with your desired resource name.
For useCreate
:
Source: useCreate documentation (https://refine.dev/docs/api-reference/core/hooks/data/useCreate)
For useDelete
:
Source: useDelete documentation (https://refine.dev/docs/api-reference/core/hooks/data/useDelete)
Remember to wrap your component with the NotificationProvider
(https://refine.dev/docs/api-reference/core/providers/notification-provider/) for the notifications to work.
----------------------useCreate | refine
useCreate is an extended version of TanStack Query's useMutation. It supports all the features of useMutation and adds some extra features.
useDelete | refine
useDelete is an extended version of TanStack Query's useMutation. It supports all the features of useMutation and adds some extra features.
Notification Provider | refine
refine let's you set a notification API by providing the notificationProvider property to the `` component.
<@1084864272280080505> kapa.ai is still learning and improving, please let us how it did by reacting below