-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot "disable" Datadog native modules in Expo Go #223
Comments
Hi @holyris, Thank you for reporting this! It looks like this "hack" has not been tested enough, sorry for that. Here's a version of the // mockDatadog.ts
import {
DdLogs,
DdTrace,
DdRum,
DdSdkReactNative,
} from "@datadog/mobile-react-native";
if (__DEV__) {
const emptyAsyncFunction = () => new Promise<void>((resolve) => resolve());
DdLogs.debug = emptyAsyncFunction;
DdLogs.info = emptyAsyncFunction;
DdLogs.warn = emptyAsyncFunction;
DdLogs.error = emptyAsyncFunction;
DdTrace.startSpan = () =>
new Promise<string>((resolve) => resolve("fakeSpanId"));
DdTrace.finishSpan = emptyAsyncFunction;
DdRum.startView = emptyAsyncFunction;
DdRum.stopView = emptyAsyncFunction;
DdRum.startAction = emptyAsyncFunction;
DdRum.stopAction = emptyAsyncFunction;
DdRum.addAction = emptyAsyncFunction;
DdRum.startResource = emptyAsyncFunction;
DdRum.stopResource = emptyAsyncFunction;
DdRum.addError = emptyAsyncFunction;
DdRum.addTiming = emptyAsyncFunction;
DdSdkReactNative.initialize = emptyAsyncFunction;
DdSdkReactNative.setUser = emptyAsyncFunction;
DdSdkReactNative.setAttributes = emptyAsyncFunction;
DdSdkReactNative.setTrackingConsent = emptyAsyncFunction;
} We also recommend switching to Expo development builds as they enable you to:
If you decide to go this way instead, tell me if you encounter any issue :) Sorry again for the inconvenience. |
On a side note, please be aware that you might encounter issues when publishing your app with Expo 44. I would strongly recommend to update to Expo 45. |
Hello, i'm using expo SDK 44 so I followed this documentation https://docs.datadoghq.com/fr/real_user_monitoring/reactnative/expo/ to disable datadog in dev mode.
The error i get:
Exception in HostObject::set for prop 'DdSdk'
Any clue ?
The text was updated successfully, but these errors were encountered: