https://www.growthbook.io/ logo
#give-feedback
Title
# give-feedback
i

important-electrician-17322

05/24/2022, 8:11 PM
flagging that from what I can tell from the React sdk code path the tracking callback for experiment assignment is called during render rather than as a side effect (useFeature doesn't have a
useEffect
anywhere)
f

future-teacher-7046

05/24/2022, 8:13 PM
Yes, tracking is done synchronously.
i

important-electrician-17322

05/24/2022, 9:46 PM
feels pretty clearly a side effect which shouldn't happen during render?
f

future-teacher-7046

05/24/2022, 10:16 PM
Yeah, that's a good point. The React SDK is just a thin wrapper around the JavaScript SDK and it's not easy with the current structure to put the tracking callback inside a useEffect hook. I'll think about this a bit.
9 Views