Files
tom goriunovandGitHub 8c0f80b778 Migrate from Yarn to pnpm (#3323)
* migrate from yarn to pnpm

* feature-reporter: migrate from webpack to vite

* remove unnecessary deps

* bump pnpm to 10.32.1

* fix sitemap and favicon generator tools in docker

* review and workflow fixes

* fix pw test

* update screenshots

* update screenshot and add default maxDiffPixels value
2026-03-02 15:10:44 +01:00

14 lines
513 B
TypeScript

import { useFeatureValue, useGrowthBook } from '@growthbook/growthbook-react';
import type { GrowthBookFeatures } from './init';
export default function useGbFeatureValue<Name extends keyof GrowthBookFeatures>(
name: Name,
fallback: GrowthBookFeatures[Name],
): { value: ReturnType<typeof useFeatureValue<GrowthBookFeatures[Name]>>; isLoading: boolean } {
const value = useFeatureValue(name, fallback);
const growthBook = useGrowthBook();
return { value, isLoading: !(growthBook?.ready ?? true) };
}