File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 1+ import type { PostHog } from 'posthog-react-native'
2+
3+ declare global {
4+ // Expose the analytics instance on the global scope for app-wide use
5+ // The PostHog instance is initialized at runtime
6+ // See src/util/tracking.ts for initialization
7+ var posthog : PostHog | undefined
8+ }
Original file line number Diff line number Diff line change @@ -171,7 +171,6 @@ if (ENV.POSTHOG_INIT != null) {
171171
172172 posthogAsync
173173 . then ( client => {
174- // @ts -expect-error Attach PostHog instance to global for analytics access
175174 global . posthog = client
176175 } )
177176 . catch ( ( e : unknown ) => {
@@ -408,10 +407,8 @@ async function logToPosthog(
408407 event : TrackingEventName ,
409408 values : TrackingValues
410409) : Promise < void > {
411- // @ts -expect-error PostHog is attached to global at runtime
412410 if ( global . posthog == null ) return
413411
414- // @ts -expect-error PostHog is attached to global at runtime
415412 global . posthog . capture ( event , values )
416413}
417414
You can’t perform that action at this time.
0 commit comments