This message was deleted.
# ask-questions
w
This message was deleted.
p
More background info here - We are using 3 different environments with sdks installed separately for each of these and also using
growthbook.loadFeatures({ autoRefresh: true })
but no change in UI is seen when overriding the variant from dev tools.
s
Hi Ustatleen, it might have to do with how you're accessing the feature. Just to clear up confusion,
autoRefresh
is to enable our SSE feature to allow for real-time events. It's not related to how DevTools will override features. Are you able to provide a snippet of the code you're using to access / render the feature? It's possible that your app is not re-rendering after updating the feature value.
p
Hey, here is my implementation
Copy code
await growthbook.loadFeatures({ autoRefresh: true }).then(() => {
      const ft = growthbook.context?.features;
      (Object.keys(ft || {}) || []).forEach(key => {
        growthbook.isOn(key);
      });
    });
s
Are you using the JS or React SDK?
p
The Js one
s
My suspicion is that your code is not re-evaluating the feature after being overridden, so the first value persists no matter what. With our React SDK, we leverage some of the react API to trigger a re-render which ends up re-evaluating. Perhaps you could make use of
setRenderer
method we provide, docs here: https://docs.growthbook.io/lib/js#re-rendering-when-features-change
1
p
We have a vanilla JS codebase, so, perhaps can you help me with a method similar to
setRenderer
but for the JS one?
s
You can use setRenderer - its part of the JS SDK. I would re-set your FF values in the setRenderer callback
🙌 1
p
Ok, let me try that out, Thank you 🙌
141 Views