-
-
Notifications
You must be signed in to change notification settings - Fork 354
Closed
getsentry/sentry-docs
#12496Description
What React Native libraries do you use?
Hermes
Are you using sentry.io or on-premise?
sentry.io (SaS)
@sentry/react-native SDK Version
6.5.0
How does your development environment look like?
Sentry.init()
Steps to Reproduce
The customer is trying to set performance metrics in a React Native app as described in the Sentry documentation on performance metrics. However, when using Sentry React Native v6.5.0, the snippet below fails with an error:
import * as Sentry from "@sentry/react-native";
const transaction = Sentry.getCurrentScope().getTransaction();
// Record amount of memory used
transaction.setMeasurement("memoryUsed", 123, "byte");
TypeError: Sentry.getCurrentScope().getTransaction is not a function (it is undefined)
Expected Result
I expect Sentry.getCurrentScope() to return a scope object with getTransaction(), per the documentation.
Actual Result
The customer gets an error that getTransaction() is undefined, and cannot record the measurement.
Metadata
Metadata
Assignees
Labels
No labels
Projects
Status
Done
Status
No status