mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* 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
14 lines
513 B
TypeScript
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) };
|
|
}
|