PostHog / posthog-js-lite

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

cant fetch payload when using memory with posthog-react-native on web #213

Closed sirpy closed 2 months ago

sirpy commented 3 months ago

Bug description

using persistence memory on web using the react-native package calling useFeatureFlagWithPayload returns undefined for payload

marandaneto commented 3 months ago

Hi @sirpy which version of the RN SDK? Can you share your SDK init code snippets?

benjackwhite commented 3 months ago

It will always return undefined at first until the SDK has had the chance to call for the feature flags at which point it will return the value via a useEffect update. Are you not seeing it at all?

marandaneto commented 3 months ago

If that is the issue, you can bootstrap the flags. or for example, disable preloadFeatureFlags, but call reloadFeatureFlagsAsync and await its results.

sirpy commented 3 months ago

@benjackwhite yeah the useEffect doesnt kick in, the value is always undefined @marandaneto using the latest one and nothing special in the Provider init code

marandaneto commented 3 months ago

@sirpy can you provide a MRE? I have a sample app and everything works fine, maybe it's something in the setup or else.

marandaneto commented 2 months ago

Closing the issue as a part of large repository cleanup, due to it being inactive and/or outdated. Please do not hesitate to ping me if it is still relevant, and I will happily reopen and work on it. Cheers!