Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
@datadog/mobile-react-navigation
Advanced tools
A client-side React Native module to interact with Datadog
react-navigation
componentsDatadog Real User Monitoring (RUM) enables you to visualize and analyze the real-time performance and user journeys of your application’s individual users. This specific package adds support to the react-navigation
library.
Note: This package is an integration for react-navigation
library, please make sure you first install and setup the core mobile-react-native
SDK.
To install with NPM, run:
npm install @datadog/mobile-react-navigation
To install with Yarn, run:
yarn add @datadog/mobile-react-navigation
To track changes in navigation as RUM Views, set the onReady
callback of your NavigationContainer
component as follow. You can use the optional ViewNamePredicate
parameter to replace the automatically detected View name with something more relevant to your use case.
Returning null
in the ViewNamePredicate
prevents the new RUM View from being created. The previous RUM View remains active.
import * as React from 'react';
import { DdRumReactNavigationTracking, ViewNamePredicate } from '@datadog/mobile-react-navigation';
import { Route } from "@react-navigation/native";
const viewNamePredicate: ViewNamePredicate = function customViewNamePredicate(route: Route<string, any | undefined>, trackedName: string) {
return "My custom View Name"
}
function App() {
const navigationRef = React.useRef(null);
return (
<View>
<NavigationContainer ref={navigationRef} onReady={() => {
DdRumReactNavigationTracking.startTrackingViews(navigationRef.current, viewNamePredicate)
}}>
// …
</NavigationContainer>
</View>
);
}
Note: Only one NavigationContainer
can be tracked at the time. If you need to track another container, stop tracking the previous one first, using DdRumReactNavigationTracking.stopTrackingViews()
.
FAQs
A client-side React Native module to interact with Datadog
The npm package @datadog/mobile-react-navigation receives a total of 62,009 weekly downloads. As such, @datadog/mobile-react-navigation popularity was classified as popular.
We found that @datadog/mobile-react-navigation demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.