how can i make a useForm from ant not automatically redirect after submit
how can i make a useForm from ant not automatically redirect after submit
useForm from Ant Design in refine, you can set the redirect property to false. This will disable the default redirection behavior.useForm from Ant Design in refine, you can use the property. This property allows you to customize the success notification that pops up after the form is submitted.useForm:useForm to display a toast notification after a successful form submission.onMutationSuccessuseGosuccessNotificationsuccessNotificationsuccessNotificationsuccessNotificationsuccessNotificationNotificationProviderNotificationProviderNotificationProviderNotificationProvideruseNotificationProvider@refinedev/antdPost Successfully created with ${data.title}``
By following these steps, you will have set up the challengeOptionschallengeOptionschallengeOptionschallengeOptionsChallengeFormChallengeFormChallengeFormuseForm({ redirect: false });useForm({
redirect: false,
onMutationSuccess: () => {
// Your custom redirection logic here
},
});useForm({
successNotification: (data, values, resource) => {
return {
message: `Post Successfully created with ${data.title}`,
description: "Success with no errors",
type: "success",
};
},
});import { useNotificationProvider } from "@refinedev/antd";
return (
<Refine
//...
notificationProvider={useNotificationProvider}
/>
); import React from "react";
import { Refine } from "@refinedev/core";
import { useNotificationProvider, RefineThemes } from "@refinedev/antd";
import { ConfigProvider, App as AntdApp } from "antd";
const App: React.FC = () => {
return (
<ConfigProvider theme={RefineThemes.Green}>
<AntdApp>
<Refine notificationProvider={useNotificationProvider}>
{/* Your application components */}
</Refine>
</AntdApp>
</ConfigProvider>
);
};
export default App;