diff --git a/frontend/src/lib/k8s/index.ts b/frontend/src/lib/k8s/index.ts index f692594c6a..5e1958e44b 100644 --- a/frontend/src/lib/k8s/index.ts +++ b/frontend/src/lib/k8s/index.ts @@ -1,5 +1,5 @@ import _ from 'lodash'; -import React from 'react'; +import React, { useMemo } from 'react'; import { matchPath, useLocation } from 'react-router-dom'; import { ConfigState } from '../../redux/configSlice'; import { useTypedSelector } from '../../redux/reducers/reducers'; @@ -94,7 +94,7 @@ export function useClustersConf(): ConfigState['allClusters'] { Object.assign(allClusters, statelessClusters); } - return allClusters; + return useMemo(() => allClusters, [Object.keys(allClusters).join(',')]); } export function useCluster() {