witty-pillow-79680
05/24/2022, 4:26 PMuseEffect
in the image, json
on line 194 is undefined. Hence, line 196 also failed since json
is undefined.
Is the undefiend json expected? If not, what would I need to do to resolve that? Than kyou.future-teacher-7046
then
block isn't returning anything. It would need to look like this:
.then((res) => {
console.log('what is res', res)
return res.json()
})
witty-pillow-79680
05/24/2022, 6:32 PMsource: unknownFeature
when I invoke the useFeature(featureName)
. Upon previous conversation, I know that this error is likely caused by the configuration of the app. My goal is to build a custom hook that implements growthbook to the specific component needed. I’m not wrapping entire app in <GrowthBookProvider>
. Ideally, I can create a custom hook that calls the useFeature
hook so that I can return the feature flag value needed in whichever component needed.
1. Is wrapping <GrowthBookProvider>
around a specific component instead of the entire app a plausible use case? Or do I need to wrap the whole app in the GrowthBook Provider?
2. Does useFeature()
need to be called in a specific order or instance? --> trying to understand where does the unknownFeature
error coming from since I could get growthbook.setFeatures
to work from your previous comment.
Thank you for your help.future-teacher-7046