Closed YoannDelpierre closed 4 years ago
Hi @YoannDelpierre, did you find a solution to this problem?
Hi @moretti , yes it's ok. I misunderstood how it works form react-ab-test point of view.
It's totally cool right now.
Thanks
@YoannDelpierre Could you share how you overcame this issue?
@YoannDelpierre Yeah, can you please share how you solved this issue? I am having the same issue using userIdentifier
. Thanks!
@joselevelsup @lpanjwani Nothing special, I just put the userIdentifier as props in Experiment component
<Experiment name={EXPERIMENT_RANGE_NAME} userIdentifier={userId}>
<Variant name={EXPERIMENT_RANGE_VARIATIONS.WITH}>xxx</VARIANT>
<Variant name={EXPERIMENT_RANGE_VARIATIONS.WITHOUT}>yyy</VARIANT>
</Experiment>
And I used
useEffect(() => {
emitter.defineVariants(EXPERIMENT_RANGE_NAME, [
EXPERIMENT_RANGE_VARIATIONS.WITH,
EXPERIMENT_RANGE_VARIATIONS.WITHOUT
]);
emitter.calculateActiveVariant(EXPERIMENT_RANGE_NAME);
}, [])
Hey,
I'm looking how to I can use this wonderfull package with NextJS and especially with SSR.
I'm using
userIdentifier
like you said, but if I force the local value to A test, it renders B test and update the local value to B value instead of keeping A value.Any idea how I can manage this ?
Thanks