diff --git a/frontend/src/hooks/api/getters/useFeature/useFeature.ts b/frontend/src/hooks/api/getters/useFeature/useFeature.ts index 95e8c77ee5..de29fd13b9 100644 --- a/frontend/src/hooks/api/getters/useFeature/useFeature.ts +++ b/frontend/src/hooks/api/getters/useFeature/useFeature.ts @@ -1,5 +1,5 @@ import useSWR, { SWRConfiguration } from 'swr'; -import { useCallback, useEffect } from 'react'; +import { useCallback } from 'react'; import { emptyFeature } from './emptyFeature'; import handleErrorResponses from '../httpErrorResponseHandler'; import { formatApiPath } from 'utils/formatPath'; @@ -32,7 +32,7 @@ export const useFeature = ( } = uiConfig; const { data, error, mutate } = useSWR( - ['useFeature', path], + ['useFeature', path, variantsPerEnvironment], () => featureFetcher(path, variantsPerEnvironment), options ); @@ -41,10 +41,6 @@ export const useFeature = ( mutate().catch(console.warn); }, [mutate]); - useEffect(() => { - mutate(); - }, [mutate, variantsPerEnvironment]); - return { feature: data?.body || emptyFeature, refetchFeature,