Hello, I am getting an issue. When I route from pa...
# announcements
b
Hello, I am getting an issue. When I route from page A to Page B the feature flag is not setting, it is setting false. But when I refresh the page the flag get set. I am using react sdk
Copy code
const showWhatsapp = useFeatureIsOn("show-whatsapp-pdp");
  console.log('show flag', showWhatsapp)
f
You probably need to use a hook to update the flag
we have some examples of this in our example repo
b
followed the same as per docs. I am using
useFeatureIsOn
to get the flag
f
do you have something like this?
Copy code
useEffect(() => {
    // Load features from the GrowthBook API and keep them up-to-date
    gb.loadFeatures({ autoRefresh: true });
  }, []);
b
yes
I tried
gb.loadFeatures()
this as well
the value in
_trackedFeatures
of the flag is coming ‘null’