}
type="text"
className={styles.addNewServiceItemButton}
diff --git a/examples/invoicer/src/pages/invoices/list.tsx b/examples/invoicer/src/pages/invoices/list.tsx
index 9b0efb5f2636..0081fe5045c4 100644
--- a/examples/invoicer/src/pages/invoices/list.tsx
+++ b/examples/invoicer/src/pages/invoices/list.tsx
@@ -75,7 +75,6 @@ export const InvoicePageList = () => {
key="id"
width={80}
defaultFilteredValue={getDefaultFilter("id", filters)}
- // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
filterIcon={
}
filterDropdown={(props) => {
return (
@@ -187,7 +186,6 @@ export const InvoicePageList = () => {
}
/>
diff --git a/examples/invoicer/src/pages/invoices/show.tsx b/examples/invoicer/src/pages/invoices/show.tsx
index bc35c978315a..6837d1592a76 100644
--- a/examples/invoicer/src/pages/invoices/show.tsx
+++ b/examples/invoicer/src/pages/invoices/show.tsx
@@ -41,7 +41,6 @@ export const InvoicesPageShow = () => {
<>
}
onClick={() => window.print()}
>
diff --git a/examples/live-provider-ably/package.json b/examples/live-provider-ably/package.json
index 901d14df7e55..bffb9ffcd372 100644
--- a/examples/live-provider-ably/package.json
+++ b/examples/live-provider-ably/package.json
@@ -22,7 +22,7 @@
]
},
"dependencies": {
- "@ant-design/icons": "5.0.1",
+ "@ant-design/icons": "^5.5.1",
"@refinedev/ably": "^4.1.8",
"@refinedev/antd": "^5.43.1",
"@refinedev/cli": "^2.16.39",
diff --git a/examples/live-provider-ably/src/components/sider/index.tsx b/examples/live-provider-ably/src/components/sider/index.tsx
index 2fd54ce136fd..3ca49b47011c 100644
--- a/examples/live-provider-ably/src/components/sider/index.tsx
+++ b/examples/live-provider-ably/src/components/sider/index.tsx
@@ -63,7 +63,6 @@ export const CustomSider: typeof Sider = ({ render }) => {
return (
}
title={label}
>
@@ -85,7 +84,6 @@ export const CustomSider: typeof Sider = ({ render }) => {
style={{
textTransform: "capitalize",
}}
- // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
icon={icon ?? (isRoute &&
)}
>
{route ?
{label} : label}
@@ -128,7 +126,6 @@ export const CustomSider: typeof Sider = ({ render }) => {
};
const logout = isExistAuthentication && (
- // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
}>
{translate("buttons.logout", "Logout")}
@@ -179,14 +176,12 @@ export const CustomSider: typeof Sider = ({ render }) => {
}}
>
{collapsed ? (
- // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
) : (
- // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
{
}
render={(_, record: TUser) => (
}
src={record.avatar_url}
size={{ xs: 24, sm: 32, md: 40 }}
diff --git a/examples/pixels/package.json b/examples/pixels/package.json
index f190b8121e0a..657c02cfe5b0 100644
--- a/examples/pixels/package.json
+++ b/examples/pixels/package.json
@@ -22,7 +22,7 @@
]
},
"dependencies": {
- "@ant-design/icons": "5.0.1",
+ "@ant-design/icons": "^5.5.1",
"@refinedev/antd": "^5.43.1",
"@refinedev/cli": "^2.16.39",
"@refinedev/core": "^4.55.0",
diff --git a/examples/pixels/src/App.tsx b/examples/pixels/src/App.tsx
index 30fbd5c75361..88b6ec7116a2 100644
--- a/examples/pixels/src/App.tsx
+++ b/examples/pixels/src/App.tsx
@@ -82,7 +82,6 @@ function App() {
{
name: "github",
icon: (
- // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
= ({ pixels }) => {
Users
{contributors.map((avatar_url) => (
- // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
} src={avatar_url} />
))}
diff --git a/examples/pixels/src/components/avatar/contributors.tsx b/examples/pixels/src/components/avatar/contributors.tsx
index 9927063500d2..3adffcbfb054 100644
--- a/examples/pixels/src/components/avatar/contributors.tsx
+++ b/examples/pixels/src/components/avatar/contributors.tsx
@@ -19,7 +19,6 @@ export const Contributors: React.FC = ({ pixels }) => {
return (
{avatarURls.map((avatar_url) => (
- // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
} src={avatar_url} />
))}
diff --git a/examples/pixels/src/components/layout/header/index.tsx b/examples/pixels/src/components/layout/header/index.tsx
index 92b9f3337403..54315b4fca31 100644
--- a/examples/pixels/src/components/layout/header/index.tsx
+++ b/examples/pixels/src/components/layout/header/index.tsx
@@ -77,7 +77,6 @@ export const Header: React.FC = () => {
}
onClick={() => {
if (isAuthenticated) {
@@ -97,7 +96,6 @@ export const Header: React.FC = () => {
onClick={() => {
mutateLogout();
}}
- // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
icon={}
title="Logout"
/>
@@ -107,7 +105,6 @@ export const Header: React.FC = () => {
onClick={() => {
handleRedirect();
}}
- // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
icon={}
title="Login"
>
diff --git a/examples/pixels/src/pages/canvases/show.tsx b/examples/pixels/src/pages/canvases/show.tsx
index e85b8abd1e57..6a1ece212fa7 100644
--- a/examples/pixels/src/pages/canvases/show.tsx
+++ b/examples/pixels/src/pages/canvases/show.tsx
@@ -77,7 +77,6 @@ export const CanvasShow: React.FC = () => {
onClick={() => list("canvases")}
style={{ textTransform: "uppercase" }}
>
- {/* @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66 */}
Back
diff --git a/examples/refine-week-invoice-generator/package.json b/examples/refine-week-invoice-generator/package.json
index 64da7567d5ca..926e0a47e0e4 100644
--- a/examples/refine-week-invoice-generator/package.json
+++ b/examples/refine-week-invoice-generator/package.json
@@ -22,7 +22,7 @@
]
},
"dependencies": {
- "@ant-design/icons": "5.0.1",
+ "@ant-design/icons": "^5.5.1",
"@react-pdf/renderer": "^3.1.8",
"@refinedev/antd": "^5.43.1",
"@refinedev/cli": "^2.16.39",
diff --git a/examples/refine-week-invoice-generator/src/App.tsx b/examples/refine-week-invoice-generator/src/App.tsx
index ffac0e0f5f90..6ae6a8ad5133 100644
--- a/examples/refine-week-invoice-generator/src/App.tsx
+++ b/examples/refine-week-invoice-generator/src/App.tsx
@@ -49,26 +49,22 @@ function App() {
{
name: "companies",
list: "/companies",
- // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
icon: ,
},
{
name: "clients",
list: "/clients",
- // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
icon: ,
},
{
name: "contacts",
list: "/contacts",
edit: "/contacts/:id/edit",
- // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
icon: ,
},
{
name: "missions",
list: "/missions",
- // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
icon: ,
},
{
@@ -76,7 +72,6 @@ function App() {
list: "/invoices",
create: "/invoices/create",
edit: "invoices/:id/edit",
- // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
icon: ,
},
]}
diff --git a/examples/refine-week-invoice-generator/src/pages/invoices/list.tsx b/examples/refine-week-invoice-generator/src/pages/invoices/list.tsx
index d0822ba1fd70..7616e84f5f8f 100755
--- a/examples/refine-week-invoice-generator/src/pages/invoices/list.tsx
+++ b/examples/refine-week-invoice-generator/src/pages/invoices/list.tsx
@@ -96,7 +96,6 @@ export const InvoiceList: React.FC = () => {
{record.company && (
}
onClick={() => {
setRecord(record);
diff --git a/examples/search/package.json b/examples/search/package.json
index dc063d4020d0..4d7ad8bee1eb 100644
--- a/examples/search/package.json
+++ b/examples/search/package.json
@@ -22,7 +22,7 @@
]
},
"dependencies": {
- "@ant-design/icons": "5.0.1",
+ "@ant-design/icons": "^5.5.1",
"@refinedev/antd": "^5.43.1",
"@refinedev/cli": "^2.16.39",
"@refinedev/core": "^4.55.0",
diff --git a/examples/search/src/components/header.tsx b/examples/search/src/components/header.tsx
index 05da85099beb..a2df33232b88 100644
--- a/examples/search/src/components/header.tsx
+++ b/examples/search/src/components/header.tsx
@@ -106,7 +106,6 @@ export const Header: React.FC = () => {
}
/>
diff --git a/examples/table-antd-table-filter/package.json b/examples/table-antd-table-filter/package.json
index 6fbd2445932f..baa79b483c2c 100644
--- a/examples/table-antd-table-filter/package.json
+++ b/examples/table-antd-table-filter/package.json
@@ -22,7 +22,7 @@
]
},
"dependencies": {
- "@ant-design/icons": "5.0.1",
+ "@ant-design/icons": "^5.5.1",
"@refinedev/antd": "^5.43.1",
"@refinedev/cli": "^2.16.39",
"@refinedev/core": "^4.55.0",
diff --git a/examples/table-antd-table-filter/src/pages/posts/list.tsx b/examples/table-antd-table-filter/src/pages/posts/list.tsx
index c8aa711e4237..de9175aad69b 100644
--- a/examples/table-antd-table-filter/src/pages/posts/list.tsx
+++ b/examples/table-antd-table-filter/src/pages/posts/list.tsx
@@ -165,7 +165,6 @@ const Filter: React.FC<{ formProps: FormProps }> = ({ formProps }) => {
}
/>
diff --git a/examples/theme-antd-demo/src/App.tsx b/examples/theme-antd-demo/src/App.tsx
index b87f30aed311..da44f363c6e7 100644
--- a/examples/theme-antd-demo/src/App.tsx
+++ b/examples/theme-antd-demo/src/App.tsx
@@ -100,7 +100,6 @@ const App: React.FC = () => {
name: "google",
label: "Sign in with Google",
icon: (
- // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
{
name: "github",
label: "Sign in with GitHub",
icon: (
- // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
{
name: "google",
label: "Sign in with Google",
icon: (
- // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
{
name: "github",
label: "Sign in with GitHub",
icon: (
- // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
{
{items}
}
style={{
fontWeight: selectedKey === "/post-review" ? "bold" : "normal",
diff --git a/examples/with-nextjs-next-auth/package.json b/examples/with-nextjs-next-auth/package.json
index af38f15eb1e2..e5d9dce63eb8 100644
--- a/examples/with-nextjs-next-auth/package.json
+++ b/examples/with-nextjs-next-auth/package.json
@@ -9,7 +9,7 @@
"start": "refine start"
},
"dependencies": {
- "@ant-design/icons": "5.0.1",
+ "@ant-design/icons": "^5.5.1",
"@ant-design/nextjs-registry": "^1.0.0",
"@refinedev/antd": "^5.43.1",
"@refinedev/cli": "^2.16.39",
diff --git a/examples/with-nextjs/package.json b/examples/with-nextjs/package.json
index 4b37a1d3e0cc..41823a98e4b3 100644
--- a/examples/with-nextjs/package.json
+++ b/examples/with-nextjs/package.json
@@ -9,7 +9,7 @@
"start": "refine start"
},
"dependencies": {
- "@ant-design/icons": "5.0.1",
+ "@ant-design/icons": "^5.5.1",
"@ant-design/nextjs-registry": "^1.0.0",
"@refinedev/antd": "^5.43.1",
"@refinedev/cli": "^2.16.39",
diff --git a/examples/with-nx/package.json b/examples/with-nx/package.json
index 3124a86f6aa7..d599540ee261 100644
--- a/examples/with-nx/package.json
+++ b/examples/with-nx/package.json
@@ -21,7 +21,7 @@
]
},
"dependencies": {
- "@ant-design/icons": "5.0.1",
+ "@ant-design/icons": "^5.5.1",
"@craco/craco": "^7.1.0",
"@refinedev/antd": "^5.38.1",
"@refinedev/cli": "^2.16.31",
diff --git a/examples/with-web3/src/App.tsx b/examples/with-web3/src/App.tsx
index c822205cbd76..8d8e9b1354cd 100644
--- a/examples/with-web3/src/App.tsx
+++ b/examples/with-web3/src/App.tsx
@@ -41,7 +41,6 @@ function App() {
list: "/",
meta: {
label: "Dashboard",
- // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
icon: ,
},
},
diff --git a/packages/antd/package.json b/packages/antd/package.json
index f7789d28597d..1708e486686d 100644
--- a/packages/antd/package.json
+++ b/packages/antd/package.json
@@ -42,8 +42,8 @@
"types": "node ../shared/generate-declarations.js"
},
"dependencies": {
- "@ant-design/icons": "5.0.1",
- "@ant-design/pro-layout": "7.17.12",
+ "@ant-design/icons": "^5.5.1",
+ "@ant-design/pro-layout": "^7.21.1",
"@refinedev/ui-types": "^1.22.9",
"@tanstack/react-query": "^4.10.1",
"antd": "^5.17.0",
diff --git a/packages/antd/src/components/autoSaveIndicator/index.tsx b/packages/antd/src/components/autoSaveIndicator/index.tsx
index bf361446a84b..e56767395979 100644
--- a/packages/antd/src/components/autoSaveIndicator/index.tsx
+++ b/packages/antd/src/components/autoSaveIndicator/index.tsx
@@ -19,7 +19,6 @@ export const AutoSaveIndicator: React.FC = ({
}
/>
),
@@ -27,7 +26,6 @@ export const AutoSaveIndicator: React.FC = ({
}
/>
),
@@ -35,7 +33,6 @@ export const AutoSaveIndicator: React.FC = ({
}
/>
),
@@ -43,7 +40,6 @@ export const AutoSaveIndicator: React.FC = ({
}
/>
),
diff --git a/packages/antd/src/components/breadcrumb/index.tsx b/packages/antd/src/components/breadcrumb/index.tsx
index 3b71d295974c..c09fccd1652e 100644
--- a/packages/antd/src/components/breadcrumb/index.tsx
+++ b/packages/antd/src/components/breadcrumb/index.tsx
@@ -70,7 +70,6 @@ export const Breadcrumb: React.FC = ({
key: "breadcrumb-item-home",
title: (
- {/* @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66 */}
{rootRouteResource?.resource?.meta?.icon ?? }
),
diff --git a/packages/antd/src/components/buttons/clone/index.tsx b/packages/antd/src/components/buttons/clone/index.tsx
index 69577e147d60..fbb9aeb30780 100644
--- a/packages/antd/src/components/buttons/clone/index.tsx
+++ b/packages/antd/src/components/buttons/clone/index.tsx
@@ -52,7 +52,6 @@ export const CloneButton: React.FC = ({
}}
>
}
disabled={disabled}
title={title}
diff --git a/packages/antd/src/components/buttons/create/index.tsx b/packages/antd/src/components/buttons/create/index.tsx
index 4d19f5dd2e93..3b7ecf03a48a 100644
--- a/packages/antd/src/components/buttons/create/index.tsx
+++ b/packages/antd/src/components/buttons/create/index.tsx
@@ -52,7 +52,6 @@ export const CreateButton: React.FC = ({
}}
>
}
disabled={disabled}
title={title}
diff --git a/packages/antd/src/components/buttons/delete/index.tsx b/packages/antd/src/components/buttons/delete/index.tsx
index a542e6c83a8f..522c143622ef 100644
--- a/packages/antd/src/components/buttons/delete/index.tsx
+++ b/packages/antd/src/components/buttons/delete/index.tsx
@@ -76,7 +76,6 @@ export const DeleteButton: React.FC = ({
}
title={title}
disabled={disabled}
diff --git a/packages/antd/src/components/buttons/edit/index.tsx b/packages/antd/src/components/buttons/edit/index.tsx
index cd40ff6cf91d..6ab3a93adae7 100644
--- a/packages/antd/src/components/buttons/edit/index.tsx
+++ b/packages/antd/src/components/buttons/edit/index.tsx
@@ -52,7 +52,6 @@ export const EditButton: React.FC = ({
}}
>
}
disabled={disabled}
title={title}
diff --git a/packages/antd/src/components/buttons/export/index.tsx b/packages/antd/src/components/buttons/export/index.tsx
index 43741fcc7d50..1a8c4de3d9c8 100644
--- a/packages/antd/src/components/buttons/export/index.tsx
+++ b/packages/antd/src/components/buttons/export/index.tsx
@@ -25,7 +25,6 @@ export const ExportButton: React.FC = ({
return (
}
data-testid={RefineButtonTestIds.ExportButton}
className={RefineButtonClassNames.ExportButton}
diff --git a/packages/antd/src/components/buttons/import/index.tsx b/packages/antd/src/components/buttons/import/index.tsx
index ffafe7050fdb..7f90592f50d8 100644
--- a/packages/antd/src/components/buttons/import/index.tsx
+++ b/packages/antd/src/components/buttons/import/index.tsx
@@ -28,7 +28,6 @@ export const ImportButton: React.FC = ({
return (
}
data-testid={RefineButtonTestIds.ImportButton}
className={RefineButtonClassNames.ImportButton}
diff --git a/packages/antd/src/components/buttons/list/index.tsx b/packages/antd/src/components/buttons/list/index.tsx
index c7bd6a5d0b95..fc64e5f1b0fa 100644
--- a/packages/antd/src/components/buttons/list/index.tsx
+++ b/packages/antd/src/components/buttons/list/index.tsx
@@ -50,7 +50,6 @@ export const ListButton: React.FC = ({
}}
>
}
disabled={disabled}
title={title}
diff --git a/packages/antd/src/components/buttons/refresh/index.tsx b/packages/antd/src/components/buttons/refresh/index.tsx
index 2d2d38a8eb35..a0fdbd248a8a 100644
--- a/packages/antd/src/components/buttons/refresh/index.tsx
+++ b/packages/antd/src/components/buttons/refresh/index.tsx
@@ -35,7 +35,6 @@ export const RefreshButton: React.FC = ({
return (
}
data-testid={RefineButtonTestIds.RefreshButton}
className={RefineButtonClassNames.RefreshButton}
diff --git a/packages/antd/src/components/buttons/save/index.tsx b/packages/antd/src/components/buttons/save/index.tsx
index 7774b59aabbd..26e2ecc2d714 100644
--- a/packages/antd/src/components/buttons/save/index.tsx
+++ b/packages/antd/src/components/buttons/save/index.tsx
@@ -25,7 +25,6 @@ export const SaveButton: React.FC = ({
return (
}
data-testid={RefineButtonTestIds.SaveButton}
className={RefineButtonClassNames.SaveButton}
diff --git a/packages/antd/src/components/buttons/show/index.tsx b/packages/antd/src/components/buttons/show/index.tsx
index 56f72621111c..bfffbe00f877 100644
--- a/packages/antd/src/components/buttons/show/index.tsx
+++ b/packages/antd/src/components/buttons/show/index.tsx
@@ -52,7 +52,6 @@ export const ShowButton: React.FC = ({
}}
>
}
disabled={disabled}
title={title}
diff --git a/packages/antd/src/components/crud/create/index.tsx b/packages/antd/src/components/crud/create/index.tsx
index e4419543209d..c395acc6ae93 100644
--- a/packages/antd/src/components/crud/create/index.tsx
+++ b/packages/antd/src/components/crud/create/index.tsx
@@ -72,7 +72,6 @@ export const Create: React.FC = ({
return (
= ({
return (
= ({
return (
= ({
return (
= ({
value,
valueLabelTrue = "true",
valueLabelFalse = "false",
- // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
trueIcon = ,
- // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
falseIcon = ,
...rest
}) => {
diff --git a/packages/antd/src/components/layout/sider/index.tsx b/packages/antd/src/components/layout/sider/index.tsx
index cee77df0fad0..1967ae8d10c1 100644
--- a/packages/antd/src/components/layout/sider/index.tsx
+++ b/packages/antd/src/components/layout/sider/index.tsx
@@ -82,7 +82,6 @@ export const Sider: React.FC = ({
>
}
title={label}
>
@@ -110,7 +109,6 @@ export const Sider: React.FC = ({
style={{
fontWeight: isSelected ? "bold" : "normal",
}}
- // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
icon={icon ?? (isRoute && )}
>
{label}
@@ -142,7 +140,6 @@ export const Sider: React.FC = ({
};
const logout = isExistAuthentication && (
- // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
}>
{translate("buttons.logout", "Logout")}
@@ -154,7 +151,6 @@ export const Sider: React.FC = ({
style={{
fontWeight: selectedKey === "/" ? "bold" : "normal",
}}
- // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
icon={}
>
{translate("dashboard.title", "Dashboard")}
@@ -230,7 +226,6 @@ export const Sider: React.FC = ({
style={drawerButtonStyles}
size="large"
onClick={() => setDrawerOpen(true)}
- // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
icon={}
/>
>
diff --git a/packages/antd/src/components/pageHeader/index.tsx b/packages/antd/src/components/pageHeader/index.tsx
index 1ffd58d63ad5..37a477db058e 100644
--- a/packages/antd/src/components/pageHeader/index.tsx
+++ b/packages/antd/src/components/pageHeader/index.tsx
@@ -15,7 +15,6 @@ export const PageHeader: FC = ({ children, ...props }) => {
const BackIcon =
direction === "rtl" ? ArrowRightOutlined : ArrowLeftOutlined;
- // @ts-expect-error Ant Design Icon's v5.0.1 has an issue with @types/react@^18.2.66
return } />;
};
const backIcon =
diff --git a/packages/antd/src/components/pages/auth/components/forgotPassword/index.tsx b/packages/antd/src/components/pages/auth/components/forgotPassword/index.tsx
index 410869b89ae6..872108960203 100644
--- a/packages/antd/src/components/pages/auth/components/forgotPassword/index.tsx
+++ b/packages/antd/src/components/pages/auth/components/forgotPassword/index.tsx
@@ -52,6 +52,7 @@ export const ForgotPasswordPage: React.FC = ({
renderContent,
formProps,
title,
+ mutationVariables,
}) => {
const { token } = theme.useToken();
const [form] = Form.useForm();
@@ -104,7 +105,9 @@ export const ForgotPasswordPage: React.FC = ({
diff --git a/packages/antd/src/hooks/form/useForm.ts b/packages/antd/src/hooks/form/useForm.ts
index 177e6e16b307..1a737df11d96 100644
--- a/packages/antd/src/hooks/form/useForm.ts
+++ b/packages/antd/src/hooks/form/useForm.ts
@@ -179,11 +179,10 @@ export const useForm = <
return;
}
+ type FieldData = Parameters[0];
+ type NamePath = FieldData[number]["name"];
// antd form expects error object to be in a specific format.
- let parsedErrors: {
- name: string | number | (string | number)[];
- errors?: string[] | undefined;
- }[] = [];
+ let parsedErrors: FieldData = [];
// reset antd errors before setting new errors
const fieldsValue = form.getFieldsValue() as unknown as object;
@@ -192,7 +191,7 @@ export const useForm = <
parsedErrors = fields.map((field) => {
return {
- name: propertyPathToArray(field),
+ name: propertyPathToArray(field) as NamePath,
errors: undefined,
};
});
@@ -228,7 +227,7 @@ export const useForm = <
}
parsedErrors.push({
- name: propertyPathToArray(key),
+ name: propertyPathToArray(key) as NamePath,
errors: newError,
});
}
diff --git a/packages/chakra-ui/src/components/fields/email/index.tsx b/packages/chakra-ui/src/components/fields/email/index.tsx
index bdb7be7e44fc..faf2e55b98d4 100644
--- a/packages/chakra-ui/src/components/fields/email/index.tsx
+++ b/packages/chakra-ui/src/components/fields/email/index.tsx
@@ -5,7 +5,7 @@ import type { EmailFieldProps } from "../types";
/**
* This field is used to display email values. It uses the {@link https://chakra-ui.com/docs/components/text `` }
- * and {@link https://chakra-ui.com/docs/components/link/usage `} components from Chakra UI.
+ * and {@link https://www.chakra-ui.com/docs/components/link `} components from Chakra UI.
*
* @see {@link https://refine.dev/docs/api-reference/chakra-ui/components/fields/email} for more details.
*/
diff --git a/packages/chakra-ui/src/components/pages/auth/components/forgotPassword/index.tsx b/packages/chakra-ui/src/components/pages/auth/components/forgotPassword/index.tsx
index a5d12b4cc6a6..5d36290d798d 100644
--- a/packages/chakra-ui/src/components/pages/auth/components/forgotPassword/index.tsx
+++ b/packages/chakra-ui/src/components/pages/auth/components/forgotPassword/index.tsx
@@ -41,6 +41,7 @@ export const ForgotPasswordPage: React.FC = ({
renderContent,
formProps,
title,
+ mutationVariables,
}) => {
const { onSubmit, ...useFormProps } = formProps || {};
const { mutate } = useForgotPassword();
@@ -99,7 +100,7 @@ export const ForgotPasswordPage: React.FC = ({
return onSubmit(data);
}
- return mutate(data);
+ return mutate({ ...mutationVariables, ...data });
})}
>
diff --git a/packages/chakra-ui/src/components/pages/auth/components/login/index.tsx b/packages/chakra-ui/src/components/pages/auth/components/login/index.tsx
index 3036f1143dc6..66dae23af881 100644
--- a/packages/chakra-ui/src/components/pages/auth/components/login/index.tsx
+++ b/packages/chakra-ui/src/components/pages/auth/components/login/index.tsx
@@ -51,6 +51,7 @@ export const LoginPage: React.FC = ({
formProps,
title,
hideForm,
+ mutationVariables,
}) => {
const { onSubmit, ...useFormProps } = formProps || {};
@@ -86,6 +87,7 @@ export const LoginPage: React.FC = ({
fontSize="sm"
onClick={() =>
login({
+ ...mutationVariables,
providerName: provider.name,
})
}
@@ -142,7 +144,7 @@ export const LoginPage: React.FC = ({
return onSubmit(data);
}
- return login(data);
+ return login({ ...mutationVariables, ...data });
})}
>
diff --git a/packages/chakra-ui/src/components/pages/auth/components/register/index.tsx b/packages/chakra-ui/src/components/pages/auth/components/register/index.tsx
index 69c489d79dce..9e734310518f 100644
--- a/packages/chakra-ui/src/components/pages/auth/components/register/index.tsx
+++ b/packages/chakra-ui/src/components/pages/auth/components/register/index.tsx
@@ -46,6 +46,7 @@ export const RegisterPage: React.FC = ({
formProps,
title,
hideForm,
+ mutationVariables,
}) => {
const { onSubmit, ...useFormProps } = formProps || {};
@@ -80,6 +81,7 @@ export const RegisterPage: React.FC = ({
leftIcon={<>{provider?.icon}>}
onClick={() =>
mutate({
+ ...mutationVariables,
providerName: provider.name,
})
}
@@ -136,7 +138,7 @@ export const RegisterPage: React.FC = ({
return onSubmit(data);
}
- return mutate(data);
+ return mutate({ ...mutationVariables, ...data });
})}
>
diff --git a/packages/chakra-ui/src/components/pages/auth/components/updatePassword/index.tsx b/packages/chakra-ui/src/components/pages/auth/components/updatePassword/index.tsx
index 7afdbdfd6015..0262aa847bed 100644
--- a/packages/chakra-ui/src/components/pages/auth/components/updatePassword/index.tsx
+++ b/packages/chakra-ui/src/components/pages/auth/components/updatePassword/index.tsx
@@ -37,6 +37,7 @@ export const UpdatePasswordPage: React.FC = ({
renderContent,
formProps,
title,
+ mutationVariables,
}) => {
const { onSubmit, ...useFormProps } = formProps || {};
const translate = useTranslate();
@@ -92,7 +93,7 @@ export const UpdatePasswordPage: React.FC = ({
return onSubmit(data);
}
- return mutate(data);
+ return mutate({ ...mutationVariables, ...data });
})}
>
diff --git a/packages/core/src/components/link/index.spec.tsx b/packages/core/src/components/link/index.spec.tsx
index 5084e20523c7..f92c8db3e83e 100644
--- a/packages/core/src/components/link/index.spec.tsx
+++ b/packages/core/src/components/link/index.spec.tsx
@@ -36,6 +36,18 @@ describe("Link", () => {
expect(link.getAttribute("aria-label")).toBe("test-label");
expect(link.getAttribute("foo")).toBe("bar");
});
+
+ it("should prioritize 'to' over 'go' when both are provided", () => {
+ const { getByText } = render(
+
+ Test
+ ,
+ );
+
+ const link = getByText("Test");
+ expect(link.tagName).toBe("A");
+ expect(link.getAttribute("href")).toBe("/with-to");
+ });
});
describe("with `go`", () => {
diff --git a/packages/core/src/components/link/index.tsx b/packages/core/src/components/link/index.tsx
index 5b4f922501f7..6d49fb06c4ce 100644
--- a/packages/core/src/components/link/index.tsx
+++ b/packages/core/src/components/link/index.tsx
@@ -13,9 +13,7 @@ type LinkPropsWithTo = {
};
export type LinkProps = React.PropsWithChildren<
- (LinkPropsWithGo | LinkPropsWithTo) &
- React.AnchorHTMLAttributes &
- TProps
+ (LinkPropsWithGo | LinkPropsWithTo) & TProps
>;
/**
@@ -25,7 +23,7 @@ export type LinkProps = React.PropsWithChildren<
*/
const LinkComponent = (
props: LinkProps,
- ref: Ref,
+ ref: Ref,
) => {
const routerContext = useContext(RouterContext);
const LinkFromContext = routerContext?.Link;
@@ -33,9 +31,6 @@ const LinkComponent = (
const goFunction = useGo();
let resolvedTo = "";
- if ("to" in props) {
- resolvedTo = props.to;
- }
if ("go" in props) {
if (!routerContext?.go) {
warnOnce(
@@ -45,6 +40,9 @@ const LinkComponent = (
}
resolvedTo = goFunction({ ...props.go, type: "path" }) as string;
}
+ if ("to" in props) {
+ resolvedTo = props.to;
+ }
if (LinkFromContext) {
return (
@@ -70,5 +68,5 @@ const LinkComponent = (
};
export const Link = forwardRef(LinkComponent) as (
- props: LinkProps & { ref?: Ref },
+ props: LinkProps & { ref?: Ref },
) => ReturnType;
diff --git a/packages/core/src/components/pages/auth/components/forgotPassword/index.spec.tsx b/packages/core/src/components/pages/auth/components/forgotPassword/index.spec.tsx
index 5c6d9a8860ae..4ff7ca762c29 100644
--- a/packages/core/src/components/pages/auth/components/forgotPassword/index.spec.tsx
+++ b/packages/core/src/components/pages/auth/components/forgotPassword/index.spec.tsx
@@ -168,4 +168,43 @@ describe("Auth Page Forgot Password", () => {
{},
);
});
+
+ it("should should accept 'mutationVariables'", async () => {
+ const forgotPasswordMock = jest.fn().mockResolvedValue({ success: true });
+
+ const { getByRole, getByLabelText } = render(
+ ,
+ {
+ wrapper: TestWrapper({
+ authProvider: {
+ ...mockAuthProvider,
+ forgotPassword: forgotPasswordMock,
+ },
+ }),
+ },
+ );
+
+ fireEvent.change(getByLabelText(/email/i), {
+ target: { value: "demo@refine.dev" },
+ });
+
+ fireEvent.click(
+ getByRole("button", {
+ name: /reset/i,
+ }),
+ );
+
+ await waitFor(() => {
+ expect(forgotPasswordMock).toHaveBeenCalledWith({
+ foo: "bar",
+ xyz: "abc",
+ email: "demo@refine.dev",
+ });
+ });
+ });
});
diff --git a/packages/core/src/components/pages/auth/components/forgotPassword/index.tsx b/packages/core/src/components/pages/auth/components/forgotPassword/index.tsx
index e7e1a4fd6dfd..90e7277e611a 100644
--- a/packages/core/src/components/pages/auth/components/forgotPassword/index.tsx
+++ b/packages/core/src/components/pages/auth/components/forgotPassword/index.tsx
@@ -27,6 +27,7 @@ export const ForgotPasswordPage: React.FC = ({
renderContent,
formProps,
title = undefined,
+ mutationVariables,
}) => {
const translate = useTranslate();
const routerType = useRouterType();
@@ -53,7 +54,7 @@ export const ForgotPasswordPage: React.FC = ({