Skip to content

Creating custom useMutation hook with 'options' parameter #3526

Answered by TkDodo
kg-lee asked this question in General
Discussion options

You must be logged in to vote

sure, its the same concept:

export function useMyMutation<
  TData = unknown,
  TError = unknown,
  TVariables = void,
  TContext = unknown
>(
  options: UseMutationOptions<TData, TError, TVariables, TContext>
) {
  // do something
  return useMutation(...)
}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@licatajustin
Comment options

@TkDodo
Comment options

Answer selected by kg-lee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants