1.115.0 fast follows (#9743)

* Fix caching, fix attributes setting

* Use useCallOnce hook

* Update dismissal handling

* Update copy
This commit is contained in:
Eric Bailey
2026-01-23 16:28:40 -06:00
committed by GitHub
parent 967b3b49d9
commit 3523e7ce58
6 changed files with 57 additions and 38 deletions
+7 -4
View File
@@ -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,