1.115.0 fast follows (#9743)
* Fix caching, fix attributes setting * Use useCallOnce hook * Update dismissal handling * Update copy
This commit is contained in:
@@ -180,6 +180,13 @@ export function AnalyticsFeaturesContext({
|
||||
}) {
|
||||
const parentContext = useContext(Context)
|
||||
|
||||
/**
|
||||
* Side-effect: we need to synchronously set this during the
|
||||
* same render cycle. It does not trigger a re-render, it just
|
||||
* sets properties on the singleton GrowthBook instance.
|
||||
*/
|
||||
setAttributes(parentContext.metadata)
|
||||
|
||||
useEffect(() => {
|
||||
feats.setTrackingCallback((experiment, result) => {
|
||||
parentContext.metric('experiment:viewed', {
|
||||
@@ -189,10 +196,6 @@ export function AnalyticsFeaturesContext({
|
||||
})
|
||||
}, [parentContext.metric])
|
||||
|
||||
useEffect(() => {
|
||||
setAttributes(parentContext.metadata)
|
||||
}, [parentContext.metadata])
|
||||
|
||||
const childContext = useMemo<AnalyticsContextType>(() => {
|
||||
return {
|
||||
...parentContext,
|
||||
|
||||
Reference in New Issue
Block a user