@datadog/mobile-react-native-navigation

中文文档
3.11.0发布于 2026/10/20Apache-2.0TypeScriptESM + CJS零依赖构建来源已验证近 30 天下载 2.8万

A client-side React Native module to interact with Datadog

原始使用文档

React-Native Monitoring for react-native-navigation components

Datadog 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-native-navigation library.

Setup

Note: This package is an integration for react-native-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-native-navigation

To install with Yarn, run:

yarn add @datadog/mobile-react-native-navigation

Track view navigation

In order to start tracking your navigation events, simply call the add the following lines before setting up your navigation. You can use the optional ViewNamePredicate callback to replace the automatically detected View name with something more relevant to your use case, based on the ComponentDidAppearEvent.

Returning null in the ViewNamePredicate prevents the new RUM View from being created. The previous RUM View remains active.

import { DdRumReactNativeNavigationTracking, ViewNamePredicate }  from '@datadog/mobile-react-native-navigation';
import { ComponentDidAppearEvent } from 'react-native-navigation';

const viewNamePredicate: ViewNamePredicate = function customViewNamePredicate(event: ComponentDidAppearEvent, trackedName: string) {
  return "My custom View Name"
}

DdRumReactNativeNavigationTracking.startTracking(viewNamePredicate);

版本与发布记录

@datadog/mobile-react-native-navigation 共发布 118 个版本,首次发布于 2021/07/26;过去 12 个月发布了 32 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
3.11.0latest2026/10/2021 天前
3.10.02026/10/091 个月前
3.9.02026/10/011 个月前
3.8.02026/09/221 个月前
3.7.02026/09/032 个月前
3.6.02026/08/172 个月前

其他发布通道:next → 2.0.0-rc.0,v2 → 2.14.9。

关于 @datadog/mobile-react-native-navigation 的常见问题

@datadog/mobile-react-native-navigation 是什么?

A client-side React Native module to interact with Datadog

如何安装 @datadog/mobile-react-native-navigation?

在项目目录运行 npm install @datadog/mobile-react-native-navigation,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(>=16.13.1)、react-native(>=0.63.4 <1.0)、react-native-navigation(^7.5.0)、@datadog/mobile-react-native(^3.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@datadog/mobile-react-native-navigation 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@datadog/mobile-react-native-navigation 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@datadog/mobile-react-native-navigation 可以商用吗?

@datadog/mobile-react-native-navigation 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@datadog/mobile-react-native-navigation 的下载量有多少?

根据 npm 官方下载统计,@datadog/mobile-react-native-navigation 在 2026/10/12 – 2026/11/10 这 30 天内被下载 27,855 次,日均约 929 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@datadog/mobile-react-native-navigation 还在维护吗?

最新版本 3.11.0 发布于 2026/10/20(21 天前);至今共发布 118 个版本,其中过去 12 个月发布了 32 个;首次发布于 2021/07/26。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。