other-emerald
other-emerald8mo ago

What are the differences between the `useNotification` and `useHandleNotification` hooks?

Id like to know more about each hook and what are their different uses and purposes.
2 Replies
kapa.ai
kapa.ai8mo ago
Hi @bombillazo. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Hmm, I don't know enough to give you a confident answer yet. The information extracts provided only mention the useNotification hook and not the useHandleNotification hook. The useNotification hook in refine is used to manually invoke notifications anywhere in a refine application. It exports the open and close methods from the notification provider, which allows you to show and hide notifications from any component. Here's a basic usage example:
const { open, close } = useNotification();

// open notification
open?.({
type: "success",
message: "Success",
description: "This is a success message",
});

// close notification
close?.("notification-key");
const { open, close } = useNotification();

// open notification
open?.({
type: "success",
message: "Success",
description: "This is a success message",
});

// close notification
close?.("notification-key");
For more detailed information about the useNotification hook, you can refer to the refine documentation (https://refine.dev/docs/api-reference/core/hooks/useNotification/). As for the useHandleNotification hook, it's not mentioned in the provided extracts. I recommend checking the official refine documentation or source code for more information about this hook. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai8mo ago
<@260960777010151436> kapa.ai is still learning and improving, please let us know how it did by reacting below