diff --git a/zh-cn/ant-design-react-native.md b/zh-cn/ant-design-react-native.md index ec6549f193d28ab88f0764fb0fdf1aec204d955e..36d1a482552853b3561f7c32c8a78e350f760a70 100644 --- a/zh-cn/ant-design-react-native.md +++ b/zh-cn/ant-design-react-native.md @@ -346,18 +346,22 @@ V5.4.2 **Modal**:对话框组件,用作显示系统的重要信息,并请求用户进行操作反馈,eg:删除某个重要内容时,弹出 Modal 进行二次确认。 -| Name | Description | Type | Required | Platform | HarmonyOS Support | -| :------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------: | :------: | :------: | :---------------: | -| visible | 对话框是否可见 | Boolean | No | All | Yes | -| closable | 是否显示关闭按钮 | Boolean | No | All | Yes | -| maskClosable | 点击蒙层是否允许关闭 | Boolean | No | All | Yes | -| onClose | 点击 x 或 mask 回调 | (): void | No | All | Yes | -| transparent | 是否背景透明 | Boolean | No | All | Yes | -| popup | 是否弹窗模式 | Boolean | No | All | Yes | -| animationType | 可选: 'fade' / 'slide' | String | No | All | Yes | -| title | 标题 | React.Element | No | All | Yes | -| footer | 底部内容 | Array [{text, onPress}] | No | All | Yes | -| onRequestClose | onRequestClose 回调会在用户按下 Android 设备上的后退按键或是 Apple TV 上的菜单键时触发。返回 true 时会在 modal 处于开启状态时阻止 BackHandler 事件。 | (): boolean | No | All | No | +| Name | Description | Type | Required | Platform | HarmonyOS Support | +| :--------------------------------: | :----------------------------------------------------------: | :----------------------------------------------------------: | :------: | :------: | :---------------: | +| visible | 对话框是否可见 | Boolean | No | All | Yes | +| closable | 是否显示关闭按钮 | Boolean | No | All | Yes | +| maskClosable | 点击蒙层是否允许关闭 | Boolean | No | All | Yes | +| onClose | 点击 x 或 mask 回调 | (): void | No | All | Yes | +| transparent | 是否背景透明 | Boolean | No | All | Yes | +| popup | 是否弹窗模式 | Boolean | No | All | Yes | +| animationType | 可选: 'fade' / 'slide' | String | No | All | Yes | +| animationDuration5.4.2+ | 动画持续时间,单位ms | Number | No | All | Yes | +| modalType5.4.2+ | 弹窗的类型,为`'portal'`时则从``根节点插入(默认),为`'modal'`时则同[`react-native/Modal`](https://reactnative.dev/docs/modal)(用于获取当前context),为`'view'`时则同`react-native/View`(用于弹窗中嵌套弹窗) | 'portal'`| `'modal'` | `'view' | No | All | Yes | +| title | 标题 | React.Element | No | All | Yes | +| footer | 底部内容 | Array [{text, onPress}] | No | All | Yes | +| onRequestClose | onRequestClose 回调会在用户按下 Android 设备上的后退按键或是 Apple TV 上的菜单键时触发。返回 true 时会在 modal 处于开启状态时阻止 BackHandler 事件。 | (): boolean | No | All | No | +| style5.4.2+ | 样式,同`styles.innerContainer` | `ViewStyle` | No | All | Yes | +| styles5.4.2+ | 语义化结构 style | [ModalStyle](https://github.com/ant-design/ant-design-mobile-rn/blob/5.4.2/components/modal/index.zh-CN.md#modalstyle-语义化样式) | No | All | Yes | **Modal.alert(title, message, actions?, platform?)**:对话框组件。 @@ -463,19 +467,23 @@ V5.4.2 **Carousel**:走马灯组件。 -| Name | Description | Type | Required | Platform | HarmonyOS Support | -| :--------------: | :--------------------: | :------------------------: | :------: | :------: | :---------------: | -| selectedIndex | 手动设置当前显示的索引 | number | No | All | Yes | -| dots | 是否显示面板指示点 | Boolean | No | All | Yes | -| vertical | 垂直显示 | Boolean | No | All | Yes | -| autoplay | 是否自动切换 | Boolean | No | All | Yes | -| autoplayInterval | 自动切换的时间间隔 | Number | No | All | Yes | -| infinite | 是否循环播放 | Boolean | No | All | Yes | -| afterChange | 切换面板后的回调函数 | (current: number): void | No | All | Yes | -| dotStyle | 指示点样式 | ViewStyle | No | All | Yes | -| dotActiveStyle | 当前激活的指示点样式 | ViewStyle | No | All | Yes | -| pageStyle | 轮播页样式 | ViewStyle | No | All | Yes | -| pagination | 自定义 pagination | (props) => React.ReactNode | No | All | Yes | +| Name | Description | Type | Required | Platform | HarmonyOS Support | +| :------------------------------------: | :----------------------------------------------------------: | :------------------------------------: | :------: | :------: | :---------------: | +| selectedIndex | 手动设置当前显示的索引 | number | No | All | Yes | +| dots | 是否显示面板指示点 | Boolean | No | All | Yes | +| vertical | 垂直显示 | Boolean | No | All | Yes | +| autoplay | 是否自动切换 | Boolean | No | All | Yes | +| autoplayInterval | 自动切换的时间间隔 | Number | No | All | Yes | +| infinite | 是否循环播放 | Boolean | No | All | Yes | +| afterChange | 切换面板后的回调函数 | (current: number): void | No | All | Yes | +| dotStyle | 指示点样式 | ViewStyle | No | All | Yes | +| dotActiveStyle | 当前激活的指示点样式 | ViewStyle | No | All | Yes | +| pageStyle | 轮播页样式 | ViewStyle | No | All | Yes | +| pagination | 自定义 pagination | (props) => React.ReactNode | No | All | Yes | +| lazy5.4.2+ | 是否懒加载。支持布尔值或函数返回 | Boolean \| `(index:number) => boolean` | No | All | Yes | +| renderLazyPlaceholder5.4.2+ | 返回自定义 React 元素以呈现尚未呈现的页面的回调。以`索引`作为参数的对象。需要启用 `lazy` 属性。 | `(index:number) => ReactNode` | No | All | Yes | +| style5.4.2+ | 轮播容器样式 (建议设置,整体轮播大小由容器决定非页内决定) | ViewStyle | No | All | Yes | +| onScrollAnimationEnd5.4.2+ | 当滚动动画结束时调用 | ()=>void | No | All | Yes | **Carousel methods** @@ -562,7 +570,7 @@ V5.4.2 | onChange | 选中后的回调 | `(value: PickerValue[], extend: PickerValueExtend) => void` | No | All | Yes | | onPickerChange | 每列数据选择变化后的回调函数 | `(value: PickerValue[], index: number) => void` | No | All | Yes | | onVisibleChange | 当显隐状态变化时回调函数 | `(visible: bool): void` | No | All | Yes | -| renderLabel | 自定义渲染每列展示的内容 | `(item: PickerColumnItem, index: number) => ReactNode` 或 `(item) => item.label` | No | All | Yes | +| renderLabel | 自定义渲染每列展示的内容 | `(item: PickerColumnItem, index: number) => ReactNode` 或 `(item) => item.label`5.1.0 `(item: PickerColumnItem, itemIndex: number,colIndex: number) => ReactNode` 或 `(item) => item.label`5.4.2+ | No | All | Yes | | title | 大标题 | ReactNode | No | All | Yes | | okText | 选中的文案 | String | No | All | Yes | | dismissText | 取消选中的文案 | String | No | All | Yes | @@ -615,7 +623,7 @@ V5.4.2 | cascade | 是否级联。子级来自`data`参数内的`children`属性 | Boolean | No | All | Yes | | cols | 列数 | Number | No | All | Yes | | onChange | 选中后的回调,可使用[rc-form](https://github.com/react-component/form) | `(value: PickerValue[], extend: PickerValueExtend) => void` | No | All | Yes | -| renderLabel | 自定义渲染每列展示的内容 | `(item: PickerColumnItem, index: number) => ReactNode` 或 `(item) => item.label` | No | All | Yes | +| renderLabel | 自定义渲染每列展示的内容 | `(item: PickerColumnItem, index: number) => ReactNode` 或 `(item) => item.label`5.1.0 `(item: PickerColumnItem, itemIndex: number,colIndex: number) => ReactNode` 或 `(item) => item.label`5.4.2+ | No | All | Yes | | loading | 是否处于加载状态 | Boolean | No | All | Yes | | loadingContent | 加载状态下展示的内容 | ReactNode | No | All | Yes | | indicatorStyle | 默认 Indicator 的样式 | Object | No | All | No | @@ -727,16 +735,17 @@ V5.4.2 **Switch**:滑动开关组件,在两个互斥对象进行选择,eg:选择开或关。 -| Name | Description | Type | Required | Platform | HarmonyOS Support | -| :---------------: | :-----------------------------------------------------: | :-------------------------------------: | :------: | :------: | :---------------: | -| checked | 是否默认选中 | Boolean | No | All | Yes | -| defaultChecked | 初始是否打开 | Boolean | No | All | Yes | -| disabled | 是否不可修改 | boolean | No | All | Yes | -| loading | 加载中的开关 | Boolean | No | All | Yes | -| onChange | 变化时的回调函数,当返回 Promise 时,会自动显示加载状态 | (val: boolean) => void 或 Promise | No | All | Yes | -| color | 开关打开后的颜色 | String | No | All | Yes | -| checkedChildren | 选中时的内容 | ReactNode | No | All | Yes | -| unCheckedChildren | 非选中时的内容 | ReactNode | No | All | Yes | +| Name | Description | Type | Required | Platform | HarmonyOS Support | +| :---------------------: | :-----------------------------------------------------: | :----------------------------------------------------------: | :------: | :------: | :---------------: | +| checked | 是否默认选中 | Boolean | No | All | Yes | +| defaultChecked | 初始是否打开 | Boolean | No | All | Yes | +| disabled | 是否不可修改 | boolean | No | All | Yes | +| loading | 加载中的开关 | Boolean | No | All | Yes | +| onChange | 变化时的回调函数,当返回 Promise 时,会自动显示加载状态 | (val: boolean) => void 或 Promise | No | All | Yes | +| color | 开关打开后的颜色 | String | No | All | Yes | +| checkedChildren | 选中时的内容 | ReactNode | No | All | Yes | +| unCheckedChildren | 非选中时的内容 | ReactNode | No | All | Yes | +| styles5.4.2+ | 语义化结构 style | [SwitchStyle](https://github.com/ant-design/ant-design-mobile-rn/blob/5.4.2/components/switch/index.zh-CN.md#switchStyle-语义化样式) | No | All | Yes | **Tabs**:标签页组件,用于让用户在不同的视图中进行切换。 @@ -928,22 +937,28 @@ V5.4.2 **Slider**:滑动输入条组件,允许用户在一个区间中选择特定值,eg:控制屏幕的显示亮度。 -| Name | Description | Type | Required | Platform | HarmonyOS Support | -| :-----------: | :----------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------: | :------: | :------: | :---------------: | -| min | 最小值 | Number | No | All | Yes | -| max | 最大值 | Number | No | All | Yes | -| step | 步长,取值必须大于 0,并且可被 (max - min) 整除。当 `marks` 不为空对象时,可以设置 `step` 为 `null`,此时 Slider 的可选值仅有 marks 标出来的部分 | Number or null | No | All | Yes | -| ticks | 是否显示刻度 | `boolean` | No | All | Yes | -| range | 是否为双滑块 | `boolean` | No | All | Yes | -| icon | 滑块的图标 | `ReactNode` | No | All | Yes | -| styles | 语义化结构 style | [SliderStyle](https://github.com/ant-design/ant-design-mobile-rn/blob/5.2.2/components/slider/index.zh-CN.md#sliderstyle-语义化样式) | No | All | Yes | -| style | 最外层容器样式 | `StyleProp` | No | All | Yes | -| marks | 刻度标记 | `{ [key: number]: React.ReactNode }` | No | All | Yes | -| value | 设置当前取值。 | Number | No | All | Yes | -| defaultValue | 设置初始取值。 | Number | No | All | Yes | -| disabled | 滑块为禁用状态 | Boolean | No | All | Yes | -| onChange | 当 Slider 的值发生改变时,会触发 onChange 事件,并把改变后的值作为参数传入 | Function | No | All | Yes | -| onAfterChange | 与 `ontouchend` 触发时机一致,把当前值作为参数传入 | Function | No | All | Yes | +| Name | Description | Type | Required | Platform | HarmonyOS Support | +| :--------------------------------: | :----------------------------------------------------------: | :----------------------------------------------------------: | :------: | :------: | :---------------: | +| min | 最小值 | Number | No | All | Yes | +| max | 最大值 | Number | No | All | Yes | +| step | 步长,取值必须大于 0,并且可被 (max - min) 整除。当 `marks` 不为空对象时,可以设置 `step` 为 `null`,此时 Slider 的可选值仅有 marks 标出来的部分 | Number or null | No | All | Yes | +| ticks | 是否显示刻度 | `boolean` | No | All | Yes | +| range | 是否为双滑块 | `boolean` | No | All | Yes | +| icon | 滑块的图标 | `ReactNode` | No | All | Yes | +| styles | 语义化结构 style | [SliderStyle](https://github.com/ant-design/ant-design-mobile-rn/blob/5.2.2/components/slider/index.zh-CN.md#sliderstyle-语义化样式) | No | All | Yes | +| style | 最外层容器样式 | `StyleProp` | No | All | Yes | +| marks | 刻度标记 | `{ [key: number]: React.ReactNode }` | No | All | Yes | +| value | 设置当前取值。 | Number | No | All | Yes | +| defaultValue | 设置初始取值。 | Number | No | All | Yes | +| disabled | 滑块为禁用状态 | Boolean | No | All | Yes | +| onChange | 当 Slider 的值发生改变时,会触发 onChange 事件,并把改变后的值作为参数传入 | Function | No | All | Yes | +| onAfterChange | 与 `ontouchend` 触发时机一致,把当前值作为参数传入 | Function | No | All | Yes | +| disabledStep5.4.2+ | 是否禁用步距;禁用后`onChange`将返回带有小数点的值 | `boolean` | No | All | Yes | +| onSlidingStart5.4.2+ | 当用户拿起滑块时调用的回调。始值作为参数传递给回调处理程序。 | Function | No | All | Yes | +| onSlidingComplete5.4.2+ | 当用户释放滑块时调用的回调,无论值是否已更改。当前值作为参数传递给回调处理程序。 | Function | No | All | Yes | +| popover5.4.2+ | 是否在拖动时显示悬浮提示,支持传入函数自定义渲染内容 | `boolean` | No | All | Yes | +| residentPopover5.4.2+ | `popover` 是否常驻显示,`popover` 存在时生效 | `boolean ` | No | All | Yes | +| tapToSeek5.4.2+ | 允许点击轨道来设置 thumb icon 位置 | `boolean` | No | All | Yes | **Popover**:气泡组件,在点击控件或者某个区域后,浮出一个气泡菜单来做更多的操作。 如果设置了遮罩层,建议通过点击遮罩层的任一位置,进行退出。 @@ -1038,10 +1053,10 @@ V5.4.2 同 `Input` 属性,外加: -| Name | Description | Type | Required | Platform | HarmonyOS Support | -| :------: | :-------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------: | :------: | :------: | :---------------: | -| autoSize | 自适应内容高度,可设置为 `true` | `false` 或对象:`{ minRows: 2, maxRows: 6 }` | No | All | Yes | -| rows | 固定显示几行,`autoSize` 优先级高 | number | No | All | Yes | +| Name | Description | Type | Required | Platform | HarmonyOS Support | +| :------: | :-------------------------------: | :----------------------------------------------------------: | :------: | :------: | :---------------: | +| autoSize | 自适应内容高度,可设置为 `true` | `false` 或对象:`{ minRows: 2, maxRows: 6 }` | No | All | No | +| rows | 固定显示几行,`autoSize` 优先级高 | number | No | All | No | | styles | 语义化结构 style | [InputStyle](https://github.com/ant-design/ant-design-mobile-rn/blob/5.2.2/components/input/index.zh-CN.md#inputstyle-语义化样式) | No | All | Yes | **Form** @@ -1143,17 +1158,18 @@ V5.4.2 **Tooltip**:气泡组件,在点击控件或者某个区域后,浮出一个气泡菜单来做更多的操作。 -| Name | Description | Type | Required | Platform | HarmonyOS Support | -| :-------------: | :--------------------------: | :-----------------------------------------------------------------------------------------------------: | :------: | :------: | :---------------: | -| children | 触发 `Tooltip` 的元素 | `React.ReactElement` | Yes | All | Yes | -| content | 弹出内容 | `React.ReactNode` | No | All | Yes | -| defaultVisible | 默认是否显隐 | `boolean` | No | All | Yes | -| mode | 设置亮色模式或者黑色模式 | `'light'` | No | All | Yes | -| onVisibleChange | 显示隐藏的回调 | `(visible: boolean) => void` | No | All | Yes | -| placement | 气泡框位置 | `'top'` | No | All | Yes | -| styles | 语义化结构 style | [TooltipStyle](https://github.com/ant-design/ant-design-mobile-rn/blob/master/#tooltipstyle-语义化样式) | No | All | Yes | -| trigger | 触发方式 | `'onPress'` | No | All | Yes | -| visible | 受控模式下,是否展示弹出内容 | `boolean` | No | All | Yes | +| Name | Description | Type | Required | Platform | HarmonyOS Support | +| :--------------------------: | :----------------------------------------------------------: | :----------------------------------------------------------: | :------: | :------: | :---------------: | +| children | 触发 `Tooltip` 的元素 | `React.ReactElement` | Yes | All | Yes | +| content | 弹出内容 | `React.ReactNode` | No | All | Yes | +| defaultVisible | 默认是否显隐 | `boolean` | No | All | Yes | +| mode | 设置亮色模式或者黑色模式 | `'light'` | No | All | Yes | +| onVisibleChange | 显示隐藏的回调 | `(visible: boolean) => void` | No | All | Yes | +| placement | 气泡框位置 | `'top'` | No | All | Yes | +| styles | 语义化结构 style | [TooltipStyle](https://github.com/ant-design/ant-design-mobile-rn/blob/master/#tooltipstyle-语义化样式) | No | All | Yes | +| trigger | 触发方式 | `'onPress'` | No | All | Yes | +| visible | 受控模式下,是否展示弹出内容 | `boolean` | No | All | Yes | +| crossOffset5.4.2+ | 设置弹窗位置的偏移量;top: 沿元素和其触发元素之间的主轴应用的附加偏移。left: 沿元素和其触发元素之间的横轴应用的附加偏移。 | `{ top: number, left: number }` | No | All | Yes | **Tooltip.Menu** @@ -1180,6 +1196,12 @@ V5.4.2 ## 其他 +- V5.4.2 三方库存在checkBox的bug(数据错乱,闪退)。源库开发者已修改, + https://github.com/ant-design/ant-design-mobile-rn/pull/1434 +- Carousel组件中的infinite为true没有循环播放(偶现),与 Android/IOS 一致[issue#1457](https://github.com/ant-design/ant-design-mobile-rn/issues/1457)。 +- Carousel组件窗口显示下面高亮按钮对应不上的问题(偶现),与 Android/IOS 一致[issue#1457](https://github.com/ant-design/ant-design-mobile-rn/issues/1457)。 +- Tabs组件onChange方法首次滑动不生效问题(偶现),与 Android/IOS 一致[issue#1457](https://github.com/ant-design/ant-design-mobile-rn/issues/1457)。 + ## 开源协议 本项目基于 [The MIT License (MIT)](https://github.com/ant-design/ant-design-mobile-rn/blob/master/LICENSE),请自由地享受和参与开源。 \ No newline at end of file diff --git a/zh-cn/galio-framework.md b/zh-cn/galio-framework.md index 3542ba05ffe722a4f036a1b582eadd5224036442..d95d97999d0a36ed8e0f6e57063d3054b1d83c99 100644 --- a/zh-cn/galio-framework.md +++ b/zh-cn/galio-framework.md @@ -19,18 +19,31 @@ ## 安装与使用 +| 三方库版本 | 支持RN版本 | +| ---------- | ---------- | +| 0.8.0 | 0.72 | +| 0.8.1 | 0.77 | + #### **npm** ```bash +# V0.8.0 npm install galio-framework@0.8.0 + +# V0.8.1 +npm install galio-framework@0.8.1 ``` #### **yarn** ```bash +# V0.8.0 yarn add galio-framework@0.8.0 + +# V0.8.1 +yarn add galio-framework@0.8.1 ``` diff --git a/zh-cn/react-native-canvas.md b/zh-cn/react-native-canvas.md index f865170e78e2c8863fa9eca216593125fb1ded47..044d929c5bfc48c8459973149c9e7bde25a102fc 100644 --- a/zh-cn/react-native-canvas.md +++ b/zh-cn/react-native-canvas.md @@ -18,6 +18,11 @@ ## 安装与使用 +| 三方库版本 | 支持RN版本 | +| ---------- | ---------- | +| 0.1.39 | 0.72 | +| 0.1.40 | 0.77 | + 进入到工程目录并输入以下命令: diff --git a/zh-cn/react-native-dotenv.md b/zh-cn/react-native-dotenv.md index 9352f90be353bdb90c121d39f50d5c459e6e4a37..a54f982a2b70cac57c169ea32e45575f9a08d55f 100644 --- a/zh-cn/react-native-dotenv.md +++ b/zh-cn/react-native-dotenv.md @@ -16,7 +16,10 @@ ## 安装与使用 - +| 三方库版本 | 支持RN版本 | +| ---------- | ---------- | +| 3.4.9 | 0.72 | +| 3.4.11 | 0.77 | 进入到工程目录并输入以下命令: @@ -25,13 +28,21 @@ #### **npm** ```bash - npm install -D react-native-dotenv@3.4.9 +# V3.4.9 +npm install -D react-native-dotenv@3.4.9 + +# V3.4.11 +npm install -D react-native-dotenv@3.4.11 ``` #### **yarn** ```bash +# V3.4.9 yarn add -D react-native-dotenv@3.4.9 + +# V3.4.11 +yarn add -D react-native-dotenv@3.4.11 ``` diff --git a/zh-cn/react-native-element-dropdown.md b/zh-cn/react-native-element-dropdown.md index 2268b9094a04a12882456e93ede3efb6e602d4f8..0da58b67568efddfca192c8a7b23f171f22561e4 100644 --- a/zh-cn/react-native-element-dropdown.md +++ b/zh-cn/react-native-element-dropdown.md @@ -16,6 +16,11 @@ ## 安装与使用 +| 三方库版本 | 支持RN版本 | +| ---------- | ---------- | +| 2.12.1 | 0.72 | +| 2.12.4 | 0.77 | + 进入到工程目录并输入以下命令: @@ -23,13 +28,21 @@ #### **npm** ```bash +# V2.12.1 npm install react-native-element-dropdown@2.12.1 + +# V2.12.4 +npm install react-native-element-dropdown@2.12.4 ``` #### **yarn** ```bash +# V2.12.1 yarn add react-native-element-dropdown@2.12.1 + +# V2.12.4 +yarn add react-native-element-dropdown@2.12.4 ``` @@ -365,6 +378,7 @@ yarn add react-native-element-dropdown@2.12.1 | searchQuery | Callback used to filter the list of items | (keyword: string, labelValue: string) => Boolean| No | All | Yes | | inputSearchStyle | Styling for input search | ViewStyle | No | All | Yes | | searchPlaceholder | The string that will be rendered before text input has been entered | String | No | All | Yes | +| searchPlaceholderTextColor2.12.4+ | The text color of the placeholder string | String | No | All | Yes | | renderInputSearch | Customize TextInput search | (onSearch: (text:string) => void) => JSX.Element| No | All | Yes | | disable | Specifies the disabled state of the Dropdown | Boolean | No | All | Yes | | dropdownPosition | Dropdown list position. Default is 'auto' | 'auto' or 'top' or 'bottom' | No | All | Yes | @@ -423,6 +437,7 @@ yarn add react-native-element-dropdown@2.12.1 | searchQuery | Callback used to filter the list of items | (keyword: string, labelValue: string) => Boolean | No | All | Yes | | inputSearchStyle | Styling for input search | ViewStyle | No | All | Yes | | searchPlaceholder | The string that will be rendered before text input has been entered | String | No | All | Yes | +| searchPlaceholderTextColor2.12.4+ | The text color of the placeholder string | String | No | All | Yes | | renderInputSearch | Customize TextInput search | (onSearch: (text:string) => void) => JSX.Element | No | All | Yes | | disable | Specifies the disabled state of the Dropdown | Boolean | No | All | Yes | | dropdownPosition | Dropdown list position. Default is 'auto' | 'auto' or 'top' or 'bottom' | No | All | Yes | diff --git a/zh-cn/react-native-error-boundary.md b/zh-cn/react-native-error-boundary.md index 720e7caa32906dbb8a95a0bf787c2518f0fe98dc..334335dea84559753e0591c0b12da97341337781 100644 --- a/zh-cn/react-native-error-boundary.md +++ b/zh-cn/react-native-error-boundary.md @@ -1,79 +1,49 @@ > 模板版本:v0.2.2

-

react-navigation-header-buttons

+

react-native-error-boundary

- + Supported platforms - + License

-> [!TIP] [Github 地址](https://github.com/vonovak/react-navigation-header-buttons) +> [!TIP] [Github 地址](https://github.com/carloscuesta/react-native-error-boundary) ## 安装与使用 | 三方库版本 | 支持RN版本 | | ---------- | ---------- | -| 12.0.0 | 0.72 | -| 13.0.0 | 0.77 | +| 1.2.4 | 0.72 | +| 1.2.9 | 0.77 | - +进入到工程目录并输入以下命令: -进入到工程目录并输入以下命令: #### **npm** ```bash -# V12.0.0 -npm i react-navigation-header-buttons@12.0.0 +# 0.72 +npm i react-native-error-boundary@1.2.4 -# V13.0.0 -npm i react-navigation-header-buttons@13.0.0 +# 0.77 +npm i react-native-error-boundary@1.2.9 ``` #### **yarn** ```bash -# V12.0.0 -yarn add react-navigation-header-buttons@12.0.0 - -# V13.0.0 -yarn add react-navigation-header-buttons@13.0.0 -``` - - -在tsconfig.json文件中添加如下代码: -```json -"compilerOptions": { - ... - "paths": { - ... - "react-navigation-header-buttons":[ - "./node_modules/react-navigation-header-buttons/lib/module/index.js" - ] - }, - } - -``` -在metro.config.js文件中添加如下代码: -```js -const config = { -... - resolver: { - unstable_enablePackageExports: true, - }, -}; -module.exports = mergeConfig( - ... - config, -); +# 0.72 +yarn add react-native-error-boundary@1.2.4 +# 0.77 +yarn add react-native-error-boundary@1.2.9 ``` @@ -82,73 +52,43 @@ module.exports = mergeConfig( > [!WARNING] 使用时 import 的库名不变。 -```js -import * as React from 'react'; -import MaterialIcons from '@expo/vector-icons/MaterialIcons'; -import { - HeaderButtons, - Item, - HiddenItem, - OverflowMenu, - Divider, - ItemProps, - HiddenItemProps, - HeaderButtonProps, - HeaderButton, -} from 'react-navigation-header-buttons'; -import { Text } from 'react-native'; - -const MaterialHeaderButton = (props: HeaderButtonProps) => ( - -); - -const EditItem = ({ onPress }: Pick) => { - return ; +```ts +import React, { PropsWithChildren, useState } from 'react'; +import { StyleSheet, Button } from 'react-native'; +import ErrorBoundary from 'react-native-error-boundary'; + +export const ErrorBoundaryDefaultExample = () => { + const [shouldThrow, setShouldThrow] = useState(false); + + return ( + +