ant-design / ant-design-mobile-rn

Ant Design for React Native
https://rn.mobile.ant.design/
MIT License
3.09k stars 611 forks source link

[Bug] SwipeAction #1348

Closed Jhh910 closed 4 days ago

Jhh910 commented 4 months ago

💬 前提强调

🙋 描述详情/重现步骤

我想要使用SwipeAction组件,添加滑动功能,但是运行报错TypeError: Cannot read property 'RectButton' of undefined 下面是我的代码: `import React from 'react'; import {View} from 'react-native'; import {List, SwipeAction} from '@ant-design/react-native';

const BasicSwipeActionExample = () => { const right = [ { text: 'More', onPress: () => console.log('more'), backgroundColor: 'orange', color: 'white', }, { text: 'Delete', onPress: () => console.log('delete'), backgroundColor: 'red', color: 'white', }, ];

const left = [ { text: 'Read', onPress: () => console.log('read'), backgroundColor: 'blue', color: 'white', }, { text: 'Reply', onPress: () => console.log('reply'), backgroundColor: 'green', color: 'white', }, ];

return ( <View style={{paddingTop: 30}}>

console.log('open')} onSwipeableClose={() => console.log('close')}> Simple example: left and right buttons
</View>

); };

export default BasicSwipeActionExample;`

🔴 版本

8.19.2

💻 运行环境

Android

⚫️ npx react-native info输出信息

System: OS: Windows 11 10.0.22621 CPU: (16) x64 12th Gen Intel(R) Core(TM) i5-12500H Memory: 2.10 GB / 15.73 GB Binaries: Node: version: 18.12.1 path: D:\nodejs\node.EXE Yarn: Not Found npm: version: 10.7.0 path: E:\SmartWater\SmartWaterAndroidApp\node_modules.bin\npm.CMD Watchman: Not Found SDKs: Android SDK: Not Found Windows SDK: Not Found IDEs: Android Studio: Not Found Visual Studio:

info React Native v0.74.2 is now available (your project is running on v0.74.0). info Changelog: https://github.com/facebook/react-native/releases/tag/v0.74.2 info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.74.0 info For more info, check out "https://reactnative.dev/docs/upgrading?os=windows".

补充说明

No response

1uokun commented 4 months ago

没有下载依赖

npm install react-native-gesture-handler
Jhh910 commented 4 months ago

没有下载依赖

npm install react-native-gesture-handler

image 下载了的

1uokun commented 3 months ago

react-native-gesture-handler@2.14.0 试一下