This message was deleted.
# ask-questions
w
This message was deleted.
👁️ 1
f
Hi Leon. Do you have a Single Page App? We already de-dupe tracking calls in the React SDK. So calling
getFeatureValue
a bunch of times for a feature should only be firing the callback once.
c
we’re on React Native, sorry should’ve added that
calls are definitly not deduped for us, both in same session as well as on multiple app opens. let me check which version we’re on:
@growthbook/growthbook-react@0.20.0
maybe the deduping uses some web APIs that don’t work as expected on RN?
f
Ok, the de-duping might not work with React Native. What I'd probably recommend is to do that yourself in your trackingCallback. If you can persist a list of previously fired calls on the device, you can add something like this to your callback:
Copy code
if (previouslyFired.includes(`${experiment.key}::${result.key}`)) return;
previouslyFired.push(`${experiment.key}::${result.key}`);

// Fire your analytics call here
c
can you point me at where this happens on the react SDK code? maybe we can try to submit a PR for RN, or at least keep the logic very similar
f
https://github.com/growthbook/growthbook/blob/main/packages/sdk-js/src/GrowthBook.ts#L1240 We're basically doing the above, but just keeping track in memory in the GrowthBook instance. So if you're creating new GrowthBook instances on every render or something like that, it could also be causing issues
c
cool thanks - we’ll take a look
153 Views