(feature)
| 219 | }; |
| 220 | |
| 221 | export 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. |
no test coverage detected