You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The useNotificationProviderhook has swapped the description and message fields.
For example, a simple call like this:
import{useNotification}from"@refinedev/core";//...const{ open }=useNotification();useEffect(()=>{open?.({type: "success",message: "Message",description: "Description"});});
Yields this notification:
Which is the opposite of the expected output, which should look like this:
As per the Ant Design Notification API, the message property corresponds to the notifications "title", whereas the description property is the "content". This is matches Refine's own specs for OpenNotificationParams.
This bug also affects indirect notification requests like the successNotification and errorNotification props of mutation parameters.
Steps To Reproduce
Create a vanilla Antd app and use the following for App.tsx
import{Refine,useNotification}from"@refinedev/core";import{useNotificationProvider}from"@refinedev/antd";import{AppasAntdApp}from"antd";import{useEffect}from"react";import{BrowserRouter,Route,Routes}from"react-router-dom";functionApp(){return(<BrowserRouter><AntdApp><RefinenotificationProvider={useNotificationProvider}><Routes><Routeindexelement={<Notif/>}/></Routes></Refine></AntdApp></BrowserRouter>);}exportdefaultApp;exportconstNotif=()=>{const{ open }=useNotification();useEffect(()=>open?.({type: "success",message: "This is the title",description: "This is the description",}),);returnnull;};
Run npm run dev and open the page.
Each time the page is refreshed, a notification will be displayed with swapped elements:
Expected behavior
The props shouldn't be swapped.
Packages
@refinedev/antd 5.44.0
@refinedev/core 4.56.0
Additional Context
No response
The text was updated successfully, but these errors were encountered:
We would love to fix this bug, but this change causes a breaking change and requires a major release. We don't want to bump the major version just for this bug. We will address this fix when we plan a major release for the UI packages.
Describe the bug
The
useNotificationProvider
hook has swapped thedescription
andmessage
fields.For example, a simple call like this:
Yields this notification:
Which is the opposite of the expected output, which should look like this:
As per the Ant Design Notification API, the
message
property corresponds to the notifications "title", whereas thedescription
property is the "content". This is matches Refine's own specs forOpenNotificationParams
.This bug also affects indirect notification requests like the
successNotification
anderrorNotification
props of mutation parameters.Steps To Reproduce
App.tsx
npm run dev
and open the page.Expected behavior
The props shouldn't be swapped.
Packages
Additional Context
No response
The text was updated successfully, but these errors were encountered: