loliklr:)L
Convex Communityβ€’8mo agoβ€’
1 reply
loliklr:)

Return type for tanstack mutation onSuccess

I am using useMutation from @tanstack/react-query with mutationFn: useConvexMutation. The onSuccess type value for the data object is unknown. How can I fix this?

  const newChat = useMutation({
    mutationFn: useConvexMutation(api.chat.create),
    onSuccess: (data) => {
      navigate(ROUTES.app.chat.id(data));
    },
  });
Was this page helpful?