PostHog / posthog-js-lite

Reimplementation of posthog-js to be as light and modular as possible.
https://posthog.com/docs/libraries
MIT License
69 stars 36 forks source link

Infinite render loop on useFeatureFlag.ts #218

Closed filipef101 closed 7 months ago

filipef101 commented 7 months ago

Bug description

https://github.com/PostHog/posthog-js-lite/blob/7e7f8dadd3aa73d9b24929280a85102af8945c48/posthog-react-native/src/hooks/useFeatureFlag.ts#L12

Likely missing dependency on useEffect?

Not sure how I only get it some times

How to reproduce

Not sure, might be after not opening the app for a while 🤔 Also doesn't seem to be affecting production, or at least not getting live reports Only saw during development

Related sub-libraries

Additional context

Thank you for your bug report – we love squashing them!

filipef101 commented 7 months ago
image
marandaneto commented 7 months ago

Hi @filipef101 Yeah I cannot reproduce this issue either, how often do you run into this issue? maybe something with hot reload?

filipef101 commented 7 months ago

Randomly saw this on dev mode, I've since migrated to using own listeners to avoid this. I'll close since I can't reproduce