Incorrect redirect behavior?
Refine app utilizing Mantine.
I have resources within App.tsx defined as,
have an edit view that uses the 'useForm' hook and manually specifying the resource,
Navigate to list view at 'directory/user', click edit or create button to navigate to another view, submit the form for that view, but the navigation goes back to 'user' instead of 'directory/user'. How would I specify the 'directory/user' resource to navigate to after a successful mutation?
2 Replies
correct-apricot•2y ago
Hey @UsererOfName when you set a custom resource, that resource is also used to determine the redirection path. You can set
redirect: false
in your useForm
hook and in onMutationSuccess
callback property, you can handle the redirect manually using useNavigation
hook, check out the docs for it here https://refine.dev/docs/api-reference/core/hooks/navigation/useNavigation/useNavigation | refine
refine uses routerProvider and comes with all redirects out of the box. It allows you to manage your routing operations in refine. Using this hook, you can manage all the routing operations of your application very easily.
rising-crimson•2y ago
Was able to proceed thanks to your help... FWIW, the list button on the standard show/edit views works as expected w/o modification