most-match-36440
10/23/2024, 3:27 PMexport const FeatureFlagProvider: FC<PropsWithChildren> = ({ children }) => {
const growthbook = useGrowthBook();
const flags = ['foo', 'bar', 'fizz', 'buzz']
return (
<EnabledFeatureFlagsContext.Provider
value={{
flags: flags.filter(flag => growthbook?.isOn(flag)),
}}>
{children}
</EnabledFeatureFlagsContext.Provider>
);
}
I'd like to wrap that in an useMemo
but the only way that I see that would work is to do something with the setRenderer
function to update some kind of context that I use here. But that seems a bit extreme, is there something that useGrowthbook
returns that I can tie the useMemo
to?