Hi team, I'm using React SDK and facing a special ...
# ask-questions
m
Hi team, I'm using React SDK and facing a special case that I need to defer the
trackingCallback
while obtaining the experiment value (for preparing data before showing on the UI). My idea is the
useFeatureValue
hook will accept the defer option, and return the
track
function that will invoke the deferred tracking call tied to the hook (similar to
gb.fireDeferredTrackingCalls()
). Example:
Copy code
const [itemsPerRow, track] = useFeatureValue("items-per-row", 3, {
    deferTrackingCallback: true
});

useInViewport(() => {
    track(); // evoke trackingCallback defined in GB instance
})

const shouldShowSidebar = itemsPerRow <= 3;
Could you consider supporting this? 🙇‍♂️