https://www.growthbook.io/ logo
#announcements
Title
# announcements
r

rhythmic-chef-84815

06/08/2022, 1:18 PM
I am trying to use the chrome extension to override the variation but I am not getting the updated value and cannot figure why the exact reason, anyone had a similar issue?
👀 1
f

future-teacher-7046

06/08/2022, 1:40 PM
Are you using the React SDK or the Javascript SDK?
r

rhythmic-chef-84815

06/08/2022, 1:40 PM
Javascript, and I think I figured out the reason
f

future-teacher-7046

06/08/2022, 1:43 PM
Ok, after the chrome extension overrides the feature, you need to re-render your app to re-evaluate all of the features. If you're using a SPA framework like Angular or Vue, you can do this pretty easily by calling the
setRenderer
function on the GrowthBook instance and give it a callback function. It will be called every time you change a feature value in the dev tools
r

rhythmic-chef-84815

06/08/2022, 1:43 PM
No I did not 😅
I am a bit lost of what I should pass exactly to the renderer, and I am using angular
f

future-teacher-7046

06/08/2022, 1:47 PM
Depends on what framework you're using
Copy code
growthbook.setRenderer(function() {
  // Code to force your application to re-render and
  // re-evaluate features
})
r

rhythmic-chef-84815

06/08/2022, 1:47 PM
Sorry for not passing the framework before
f

future-teacher-7046

06/08/2022, 1:52 PM
I'm not too familiar with Angular. In our React SDK, we have a counter that we increment every time the render function is called. And we pass that counter value to any component that is using features. This forces the components to re-render when the counter changes
r

rhythmic-chef-84815

06/08/2022, 1:57 PM
so you basically have to pass this to every component?
I would like to avoid this and be able to implement a more generic approach instead of adding logic to every single component
f

future-teacher-7046

06/08/2022, 1:59 PM
In React we're using Context, which does just that. Not sure if Angular has something similar. Basically, any component that calls
useFeature("my-feature")
will be re-rendered automatically, but nothing else will be
r

rhythmic-chef-84815

06/08/2022, 2:09 PM
I am trying to understand something here, without any override I have this value
after I override the current value, I just want to change the variation
I think I am trying something wrong here
f

future-teacher-7046

06/08/2022, 2:25 PM
So if I understand correctly you have an experiment rule for a feature and you want to switch between the different variations. Is that right?
r

rhythmic-chef-84815

06/08/2022, 2:25 PM
Exactly
f

future-teacher-7046

06/08/2022, 2:27 PM
Do you see the "Experiments" section in devtools? That's where you can switch between variations.
Overriding the feature value directly takes precedence over the experiment, so you might need to revert that global override first (icon next to "Current Value"
r

rhythmic-chef-84815

06/08/2022, 2:31 PM
there is something wrong with my test setup I think, I have values 1 and 2 as you can see here
but in the chrome extension when I go to variation 2 the value goes tto 0
f

future-teacher-7046

06/08/2022, 2:33 PM
do you want to hop on a quick call and share your screen? Might be easier to debug that way
r

rhythmic-chef-84815

06/08/2022, 2:33 PM
I would really appreciate it
I figured out the devtools issue. The chrome extension has it's own copy of the Javascript SDK that it uses internally and that version is out of date and displaying the wrong value when an experiment variation is forced.
r

rhythmic-chef-84815

06/08/2022, 2:59 PM
Can I have it fixed somehow?
f

future-teacher-7046

06/08/2022, 2:59 PM
yep, I'm deploying a new version of the extension in a minute. Doing final testing now
r

rhythmic-chef-84815

06/08/2022, 2:59 PM
About the SSR thing now I am only updating the id when it is in the browser so the id is the correct one now
I compared with the one in the extension and it is indeed the same one
f

future-teacher-7046

06/08/2022, 3:11 PM
That's good. I submitted the updated chrome extension, but it needs to go through Google's review process before it's available which could take a day or two.
r

rhythmic-chef-84815

06/08/2022, 3:11 PM
hmm I think I can live with our current override logic until then
140 Views