Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion example-new-architecture/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
DdLogs,
DdTrace,
TrackingConsent,
LogsConfiguration,
} from '@datadog/mobile-react-native';
import React from 'react';
import type {PropsWithChildren} from 'react';
Expand Down Expand Up @@ -46,7 +47,9 @@ import {APPLICATION_ID, CLIENT_TOKEN, ENVIRONMENT} from './ddCredentials';
trackErrors: true,
sessionSampleRate: 100,
telemetrySampleRate: 100,
}
},
logsConfiguration: {},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were missing from the example app.

traceConfiguration: {}
}
);
config.verbosity = SdkVerbosity.DEBUG;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ class DdSdkImplementation(
val nativeInitialization = DdSdkNativeInitialization(appContext, datadog, ddTelemetry)
nativeInitialization.initialize(ddSdkConfiguration)

val activity = reactContext.currentActivity
if (ddSdkConfiguration.rumConfiguration != null && activity != null) {
Copy link

@aleksandr-gringauz aleksandr-gringauz Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to better understand. Is it possible that Activity is actually null here? Or currentActivity is just nullable in ReactContext and in the real life we will never see null here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's possible for the Activity to be null at this point, but as you mentioned, since it is nullable we need to be overly cautious.

Also, the first check is there to avoid enabling this if RUM is not enabled.

datadog.getRumMonitor()._getInternal()?.enableJankStatsTracking(activity)
}

this.frameRateProvider = createFrameRateProvider(ddSdkConfiguration)

reactContext.addLifecycleEventListener(object : LifecycleEventListener {
Expand Down
Loading