# @fintoc/fintoc-react-native 中文文档

规范地址：https://npmcn.com/package/%40fintoc/fintoc-react-native/

版本：1\.0\.3
npm 元数据更新时间：2026-04-30T16:26:18.197Z
中文译文更新时间：2026-11-14T20:08:09.353Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40fintoc/fintoc-react-native
原文对照：https://npmcn.com/package/%40fintoc/fintoc-react-native/?lang=original
项目主页：https://github.com/fintoc-com/fintoc-react-native#readme
源码仓库：https://github.com/fintoc-com/fintoc-react-native

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：22.2 kB，19 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- 运行依赖：0 个
- peer 依赖：react \*，react-native \*，react-native-webview \*
- 首次发布：2022-03-24T05:11:38.189Z
- 最新版本发布：2025-09-25T16:02:16.302Z
- 近 30 天下载量：2396（2026-10-15 至 2026-11-13，npm 官方下载统计）
- 已发布版本数：8（近 12 个月 0 个）

## 中文简介

# Fintoc 反应原生

## 安装

```sh
npm install @fintoc/fintoc-react-native
```

也可以使用：`pnpm add @fintoc/fintoc-react-native`、`yarn add @fintoc/fintoc-react-native`、`bun add @fintoc/fintoc-react-native`

## README

# Fintoc 反应原生

_使用 [Fintoc 部件](https://docs.fintoc.com/docs/widget) 在您作为视图的本地应用程序中._

 [![NPM - Version](https://img.shields.io/npm/v/@fintoc/fintoc-react-native?label=version&logo=nodedotjs&logoColor=%23fff&color=306998)](https://www.npmjs.com/package/@fintoc/fintoc-react-native)[![Linters](https://img.shields.io/github/workflow/status/fintoc-com/fintoc-react-native/linters?label=linters&logo=github)](https://github.com/fintoc-com/fintoc-react-native/actions?query=workflow%3Alinters)

## 安装

用 npm 安装 ! (或您最喜欢的软件包管理器)

```sh
# Using npm
npm install @fintoc/fintoc-react-native

# Using yarn
yarn add @fintoc/fintoc-react-native
```

## 使用量

`Fintoc React Native` 输出一个称为 `FintocWidgetView`。这是一个 React 原生组件,它从 [本地 WebView 文档](https://docs.fintoc.com/docs/widget-webview-integration#how-it-works)。要使用 Fintoc 视图,请使用以下 _片断_数字 :

```js
import { FintocWidgetView } from '@fintoc/fintoc-react-native';
```

获取后 `FintocWidgetView` 组件,您可以立即切换部件 :

```jsx
const options = { ... };

const onSuccess = () => {
  console.log('SUCCESS');
};

const onExit = () => {
  console.log('EXIT');
};

export default function FintocWidgetScreen() {
  return (
    <FintocWidgetView
      options={options}
      onSuccess={onSuccess}
      onExit={onExit}
    />
  );
}
```

这里, `options` 与部件收到的参数对应对象( 您可以读取更多关于这些参数的内容) [这里](https://docs.fintoc.com/docs/widget-webview-integration#how-it-works)),以及 `onSuccess` 财务报告和审定财务报表 `onExit` 对应详细WebView重定向 [这里](https://docs.fintoc.com/docs/widget-webview-integration#webview-redirections)。 。 。 .

**注意到** 关闭 Fintoc 视图 **必须卸载**。这是因为如果 Fintoc 视图没有重新打开,部件不会重新打开,所以我建议将组件卸载在 `onClose` 方法.

## 类型脚本支持

这个包包括了Fintoc视图的TypeScript声明.

## 发展中国家

要开发软件包, 您需要使用 `npm`。安装依赖:

```sh
npm install
```

为了在当地测试,我建议把应用程序包装起来。 记得先建库:

```sh
npm run build
npm pack
```

这将创建一个 `fintoc-fintoc-react-native-1.3.1.tgz` 文件(带有相应的软件包版本)。 现在,去另一个目录 并创建一个反应原生应用程序(使用 Expo,也许). 在创建新应用程序后,在它的属性中添加以下 `package.json` 文件 :

```json
{
  "dependencies": {
    ...,
    "@fintoc/fintoc-react-native": "file:./path/to/fintoc-fintoc-react-native-0.3.1.tgz",
    ...
  }
}
```

何处 `./path/to/fintoc-fintoc-react-native-0.3.1.tgz` 对应于通往 `.tgz` 创建于 `npm pack` 步骤。 运行后 `npm install` 在新的 React 原生应用程序上, 您应该能够使用 Fintoc React 原生软件导入 Fintoc 视图 .

如果你想创建一个新的 _释放_,您可以运行:

```sh
git switch main
npm run bump! <major|minor|patch>
```

这将创建一个新的分支, 其更新版本来自 `main`。 。 。 .

## 鸣谢

此项实施工作系以下列各方的投入和经验为基础编制: [**@mariluisaclaro (英语)**](https://github.com/marialuisaclaro) 使用React Introduct整合了WebView,这为这个库的一般理念提供了一个很好的起点.

## 常见问题

### @fintoc/fintoc-react-native 是什么？

Fintoc 反应原生

### 如何安装 @fintoc/fintoc-react-native？

在项目目录运行 npm install @fintoc/fintoc-react-native，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：react（\*）、react-native（\*）、react-native-webview（\*）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @fintoc/fintoc-react-native 支持 TypeScript 吗？

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

### @fintoc/fintoc-react-native 支持 ESM 还是 CommonJS？

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

### @fintoc/fintoc-react-native 可以商用吗？

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

### @fintoc/fintoc-react-native 的下载量有多少？

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

### @fintoc/fintoc-react-native 还在维护吗？

最新版本 1\.0\.3 发布于 2025/09/26（1\.1 年前）；至今共发布 8 个版本，其中过去 12 个月发布了 0 个；首次发布于 2022/03/24。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

