@duffel/react-native-components

中文文档
7.0.2发布于 2026/05/08MITTypeScriptESM + CJS近 30 天下载 4.4万

UI components to support selling travel with the Duffel API

原始使用文档

@duffel/react-native-components

End of life

@duffel/react-native-components is end of life. Version 7.0.2 is the final version of this package and no new features will be added here.

This package previously bundled Card Form, 3DS, Ancillaries, and Assistant APIs. Those surfaces now live in dedicated packages so you can install only what you use and avoid unrelated native peer dependencies.

Use these packages instead:

  • @duffel/react-native-components-card-form for DuffelCardForm, useDuffelCardFormActions, DuffelThreeDSecureProvider, and useCreate3DSecureSession
  • @duffel/react-native-components-ancillaries for DuffelAncillaries
  • @duffel/react-native-components-assistant for DuffelAssistant

Migration

Replace imports from the umbrella package with the dedicated package for the API you use.

// Before
import {
  DuffelCardForm,
  DuffelThreeDSecureProvider,
} from '@duffel/react-native-components';

// After
import {
  DuffelCardForm,
  DuffelThreeDSecureProvider,
} from '@duffel/react-native-components-card-form';
// Before
import { DuffelAncillaries } from '@duffel/react-native-components';

// After
import { DuffelAncillaries } from '@duffel/react-native-components-ancillaries';
// Before
import { DuffelAssistant } from '@duffel/react-native-components';

// After
import { DuffelAssistant } from '@duffel/react-native-components-assistant';

For new integrations, do not install @duffel/react-native-components. Install the dedicated package instead and add its peer dependencies to your app.

版本与发布记录

@duffel/react-native-components 共发布 96 个版本,首次发布于 2024/09/06;过去 12 个月发布了 18 个版本。

版本发布日期距今
7.0.2latest2026/05/086 个月前
7.0.12026/04/206 个月前
7.0.02026/04/176 个月前
6.0.02026/04/027 个月前
5.0.02026/02/109 个月前
4.0.02026/01/299 个月前

其他发布通道:canary → 4.0.0-canary.0。

关于 @duffel/react-native-components 的常见问题

@duffel/react-native-components 是什么?

UI components to support selling travel with the Duffel API

如何安装 @duffel/react-native-components?

在项目目录运行 npm install @duffel/react-native-components,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(*)、@duffel/api(4.2.1)、react-native(*)、react-native-svg(*)、react-native-webview(*)、@evervault/react-native(2.3.0)、react-native-mask-input(>=1.2.3)、react-native-picker-select(>=9.3.1)、@react-native-picker/picker(>=2.11.4)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@duffel/react-native-components 支持 TypeScript 吗?

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

@duffel/react-native-components 支持 ESM 还是 CommonJS?

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

@duffel/react-native-components 可以商用吗?

@duffel/react-native-components 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@duffel/react-native-components 的下载量有多少?

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

@duffel/react-native-components 还在维护吗?

最新版本 7.0.2 发布于 2026/05/08(6 个月前);至今共发布 96 个版本,其中过去 12 个月发布了 18 个;首次发布于 2024/09/06。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。