R
Refine

ask-any-question

notification that not closes automaticly

Llike-gold3/26/2024
How can I create a notification with useNotification that not closes automaticly?
Kkapa.ai3/26/2024
Hi @Jaoc1811. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- To create a notification that does not close automatically, you can use the useNotification hook provided by Refine. This hook allows you to manually control the opening and closing of notifications. Here is an example of how to use it:
import { useNotification } from "@refinedev/core";

const { open, close } = useNotification();

// Open notification
open({
type: "success",
message: "Success",
description: "This is a success message",
key: "unique-id",
});
import { useNotification } from "@refinedev/core";

const { open, close } = useNotification();

// Open notification
open({
type: "success",
message: "Success",
description: "This is a success message",
key: "unique-id",
});
In this example, a notification is opened with the open method. The notification will not close automatically. To close the notification, you need to call the close method with the key of the notification:
// Close notification
close("unique-id");
// Close notification
close("unique-id");
Please note that the key is used to identify the notification that should be closed. So, it's important to use a unique key when you open a notification. For more information, you can refer to the useNotification documentation (https://refine.dev/docs/notification/hooks/use-notification/). Please note that Refine typically manages notifications for you automatically. In most cases, you won't need to manually open and close notifications. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
Kkapa.ai3/26/2024
<@110864105035808768> kapa.ai is still learning and improving, please let us know how it did by reacting below
Llike-gold3/26/2024
but it is closed automaticly opening it this way @kapa.ai
Kkapa.ai3/26/2024
Let me check the knowledge base for you. One moment! :books: ---------------------- I apologize for the confusion. The useNotification hook in Refine doesn't provide an out-of-the-box way to prevent a notification from closing automatically. The notifications created with the open method will close automatically after a certain duration. If you want to create a notification that doesn't close automatically, you might need to create a custom notificationProvider and handle the notification close logic yourself. However, this is not directly covered in the provided knowledge sources. For more information on creating a custom notificationProvider, you can refer to the Refine documentation (https://refine.dev/docs/notification/notification-provider). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
Kkapa.ai3/26/2024
<@110864105035808768> kapa.ai is still learning and improving, please let us know how it did by reacting below

Looking for more? Join the community!

R
Refine

ask-any-question

Join Server
Recommended Posts
Refine AntD Form create new recordsHow do I conventionally code a component that have an antd "Form" with input, map those inputs to eanextjsHi everyone, what is the recommended way to build an app with Refine, using Next.js or React?WebSocket is closed before the connection is established (localhost:5002)Hello Just following refine's supabase tutorial, I just setup the project (no crud yet), and can't gHow to make a download from public directory (Next.js frontend)I am using Next.js frontend and I want to add the user to download a pdf file. I created /src/publiQuestion about Refines backendI’m just starting off working with the template CRM app mainly for its Kanban board. I deployed the Nested route problemsI'm using Refine and Antd. My app.tsx: <Refine dataProvider={dataProvider(supabaseClError when submitting form via Ant Design's useModalForm.I get the following error: ``` Converting circular structure to JSON --> starting at object with conrefinehow to use refine with firebase?ThemeLayoutV2 ModificationHow do I modify the ThemeLayoutV2 or Sider for Antd5 so that the default behavoir is to land on the Confirmation on mutate updateHow can i add Confirmation on mutate update for useUpdateLogin/ Register authHello, im following this tutorial https://youtu.be/6a3Dz8gwjdg. Everything was working fine until iWeb browser autocomplete not trigger form updateI had a form like this but when the user uses the web browser autocomplete function, data inside thereact-i18next empty objectHi, I am following https://refine.dev/docs/guides-concepts/i18n/#adding-the-translations-files To Whomai unauthorised issue@kapa.ai I have an error showing in the console "http://localhost:5001/api/sessions/whomai" 401 unauCan I use supabase as backend in the CRM example??I have been trying to create a management application and the refine CRM has most of the features anApp CRM applicationHey all, I am trying to fork the App CRM application for a personal project, and I need help unders