MCPcopy Create free account
hub / github.com/dailydotdev/apps / useFeature

Function useFeature

packages/shared/src/components/GrowthBookProvider.tsx:221–227  ·  view source on GitHub ↗
(feature)

Source from the content-addressed store, hash-verified

219};
220
221export const useFeature: GetFeatureValue = (feature) => {
222 const { growthbook } = useGrowthBookContext();
223
224 return growthbook
225 ? growthbook.getFeatureValue(feature.id, feature.defaultValue)
226 : (feature.defaultValue as WidenPrimitives<typeof feature.defaultValue>);
227};
228
229// Re-exported so harnesses (Storybook, tests) can pin an experiment arm without
230// depending on the GrowthBook package directly.

Callers 15

InlineAdFunction · 0.90
SidebarAdFunction · 0.90
WithExperimentFunction · 0.90
MainFeedLayoutFunction · 0.90
PlusExtensionFunction · 0.90
PersonalizedDigestFunction · 0.90
LanguageDropdownFunction · 0.90
BookmarkSectionFunction · 0.90
ExploreSectionFunction · 0.90
ShareGrid.tsxFile · 0.90
ShareList.tsxFile · 0.90
AdGrid.tsxFile · 0.90

Calls 1

useGrowthBookContextFunction · 0.85

Tested by

no test coverage detected