diff --git a/x-pack/plugins/fleet/public/hooks/use_request/outputs.ts b/x-pack/plugins/fleet/public/hooks/use_request/outputs.ts index 2d623da505c65..214fa5f5ed142 100644 --- a/x-pack/plugins/fleet/public/hooks/use_request/outputs.ts +++ b/x-pack/plugins/fleet/public/hooks/use_request/outputs.ts @@ -5,8 +5,6 @@ * 2.0. */ -import { useMemo, useCallback } from 'react'; - import { outputRoutesService } from '../../services'; import type { PutOutputRequest, GetOutputsResponse } from '../../types'; @@ -21,17 +19,9 @@ export function useGetOutputs() { export function useDefaultOutput() { const outputsRequest = useGetOutputs(); - const output = useMemo(() => { - return outputsRequest.data?.items.find((o) => o.is_default); - }, [outputsRequest.data]); - - const refresh = useCallback(() => { - return outputsRequest.resendRequest(); - }, [outputsRequest]); + const output = outputsRequest.data?.items.find((o) => o.is_default); - return useMemo(() => { - return { output, refresh }; - }, [output, refresh]); + return { output, refresh: outputsRequest.resendRequest }; } export function sendPutOutput(outputId: string, body: PutOutputRequest['body']) {