Closed Amber-Williams closed 3 years ago
Hi @Amber-Williams, so in this case you're rendering two experiments with same name and you would expect component 2 to choose variant A on SSR, because you passed defaultVariantName
to component 1?
Does component 2 render after component 1?
Have you tried calling emitter.setActiveVariant
instead?
Can you create a small example on codesandbox.io to illustrate the problem? Thanks!
I have the following with a defaultVariantName defined in one component with the same experiment as another component. My app works with just one defined but if I want to define it again to make it consistent it breaks.
A suggestion is to define the defaultVariantName within the .defineVarients() method so it is defined where the other definitions are created
PushtellEventEmitter.prototype.defineVariants = function(experimentName, variantNames, variantWeights, defaultVariantName)