useNotification error
I'm trying to use useNotification hook to show some notifications. It is working, but i'm getting this error on console
how can I solve it?
how can I solve it?
App component from Ant Design to ensure that the notifications are also receiving the current theme configuration. App component from antd. Here's an example of how you can do it:@refinedev/antd package is used in the prop of the component. This allows the notifications to consume the current theme context.App component from antd and the export from @refinedev/antd. Then, pass as the prop in the component. Here's an example of how you can do it:@refinedev/antd package is used in the prop of the component. This allows the notifications to consume the current theme context.RefineRefineRefineRefineuseNotificationProvideruseNotificationProvideruseNotificationProvideruseNotificationProvidernotificationProvidernotificationProvidernotificationProvidernotificationProvidernotificationProviderthemeimport { Refine } from "@refinedev/core";
import { useNotificationProvider, RefineThemes } from "@refinedev/antd";
import { App as AntdApp } from "antd";
const App = () => {
return (
<ConfigProvider theme={RefineThemes.Green}>
<AntdApp>
<Refine notificationProvider={useNotificationProvider}>
{/* ... */}
</Refine>
</AntdApp>
</ConfigProvider>
);
}; import { Refine } from "@refinedev/core";
import { ThemedLayoutV2, useNotificationProvider } from "@refinedev/antd";
import { ConfigProvider, App as AntdApp } from "antd";
const API_URL = "<https://api.fake-rest.refine.dev";>
const App: React.FC = () => {
return (
<ConfigProvider theme={RefineThemes.Blue}>
<AntdApp>
<Refine
//...
notificationProvider={useNotificationProvider}
>
<ThemedLayoutV2>{/* ... */}</ThemedLayoutV2>
</Refine>
</AntdApp>
</ConfigProvider>
);
};