TanStackT
TanStack3y ago
8 replies
technological-jade

Is it possible to extract useMutation from the component/page file in Next.js?

I would like to define all the useMutations and useQueries (like updateUser, deleteUser, createUser, getUsers, getUser) together inside a UserAPI.ts file. I found the following example where they have extracted them from the main component: https://v2.mantine-react-table.com/docs/examples/editing-crud
Learn how to use editing and all the CRUD functionality of Mantine React Table
Editing CRUD Mantine React Table Example
Was this page helpful?