diff --git a/zh-cn/react-native-modals.md b/zh-cn/react-native-modals.md new file mode 100644 index 0000000000000000000000000000000000000000..d9b3dd6b0a6932273c2b45d2f98b63a627222360 --- /dev/null +++ b/zh-cn/react-native-modals.md @@ -0,0 +1,243 @@ + +模板版本:v0.2.2 + +

+

react-native-modals

+

+ +

+ + Supported platforms + + + License + +

+ + +> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-modals) + + +## 安装与使用 + +请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-modals Releases](https://github.com/react-native-oh-library/react-native-modals/releases),并下载适用版本的 tgz 包。 + +进入到工程目录并输入以下命令: + +> [!TIP] # 处替换为 tgz 包的路径 + + + +#### **npm** + +```bash +npm install @react-native-oh-tpl/react-native-modals@file:# +``` + +#### **yarn** + +```bash +yarn add @react-native-oh-tpl/react-native-modals@file:# +``` + + + +下面的代码展示了这个库的基本使用场景: + +> [!WARNING] 使用时 import 的库名不变。 + +```js + +import { ModalPortal } from 'react-native-modals'; +import { Provider } from 'react-redux'; + +const Root = () => { + return ( + + + + + ); +} + +``` + + +```js +import React, { useState } from 'react' +import { Modal, ModalContent } from 'react-native-modals'; +import { Button } from 'react-native' + +export default () => { + + return ( + <> + +