-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
I'm using onChoice callback to trigger some tracking, however, it is being called two times
<Experiment
name="Wanted listing button label"
onChoice={(experimentName, variantName) => {
console.log('test', Math.random())
track(EXPERIMENT_VIEWED, {
variant: variantName,
experiment: experimentName,
})
setExperiment(experimentName)
setVariant(variantName)
}}
>
<Variant name="A (current)">{t('event:cta.wanted')}</Variant>
<Variant name="B (new)">{t('event:cta.wanted_variant')}</Variant>
</Experiment>So on render this is the output
I tried to make my component a pure component or even using memo on Experiment component with no success.
Any ideas?
Metadata
Metadata
Assignees
Labels
No labels
