Hello, I've successfully integrated Growthbook us...
# give-feedback
m
Hello, I've successfully integrated Growthbook using the @green-kite-41783/growthbook-react SDK. We're eager to run an A/B test on our pricing plans and have created a feature for pricing variations as follows: const enabled = useFeatureIsOn("new-pricing"); The issue we're facing is that when the "new-pricing" feature is set to false, everything works smoothly. However, when the feature is enabled, we're experiencing lagging for a short period of time (please refer to the attached video). We would greatly appreciate your guidance on how to resolve this issue. Your assistance will be invaluable in ensuring a seamless A/B testing process. Thank you in advance for your support!
w
m
Yes I have used a fallback UI
image.png
w
Try calling
const enabled = useFeatureIsOn("new-pricing")
from within the PricingPage itself, instead of passing it in as a prop. As you have it now the enabled variable is loading from outside the FeaturesReady logic.
m
I have tried calling useFeatureIsOn in the PricingPage component but the issue persists
w
and you changed the code to use it and got rid of the prop?
You can set
gb.debug=true
on your growthbook object to see console logs of how gb evaluates your feature. That might help you in understanding what is going on.
f
It could be caused by a delay when loading the attributes…
There are some ways around this
one would be to initially not load a price at all, then load in the price based on which variation is loaded - it will flicker, but may just look like loading
it looks like it is assigning a variation, then switching variations (instead of loading the spinner) - which can happen if the attributes change
m
Is there any way to load variations on the server and serve the pricing page with variations? It will help improve user experience
f
sure
m
ok thanks, @fresh-football-47124 for your support, I am working on rendering variations server-side
thanks @white-fireman-22476 for sorting your support
f
you just have to log that exposure event, doesn’t have to happen client side or server side - but has to happen somewhere