Skip to content

Commit

Permalink
[Security Solution] - fixing infinite look on host flyout panel due t…
Browse files Browse the repository at this point in the history
…o lack of memoization
  • Loading branch information
PhilippeOberti committed Dec 19, 2024
1 parent 7678141 commit 2f92c3b
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { useCallback, useEffect, useState } from 'react';
import { useCallback, useEffect, useMemo, useState } from 'react';
import type { Severity } from '@kbn/securitysolution-io-ts-alerting-types';

import { useDispatch } from 'react-redux';
Expand Down Expand Up @@ -200,12 +200,17 @@ export const useAlertsByStatus: UseAlertsByStatus = ({
}
}, [skip, refetchQuery]);

useQueryInspector({
deleteQuery,
inspect: {
const inspect = useMemo(
() => ({
dsl: [request],
response: [response],
},
}),
[request, response]
);

useQueryInspector({
deleteQuery,
inspect,
refetch,
setQuery,
queryId,
Expand Down

0 comments on commit 2f92c3b

Please sign in to comment.