Closed marandaneto closed 9 months ago
Change looks good to me. Not really clear what I would change in my code as an integrator to fix the crash (if anything). Might be worth documenting that or making an example if you think it's necessary
there's no change to be made since the client
is optional and the provider creates them automatically, the provider already has an optional client
which is already passed.
Problem
Probably solves https://github.com/PostHog/posthog-js-lite/issues/182
I suspect that when there are more promises to be resolved, posthog tries to use its instance but it's not ready yet.
Changes
The changes allow passing the custom
posthog
to the hooks instead of always usingusePostHog
, which is likely already resolved since it was either passed or created by the provider. If it's not ready, at least it'll bail out instead of crashing.Release info Sub-libraries affected
Bump level
Libraries affected
Changelog notes