You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

React Native Reanimated版本识别异常求助:触摸失效多步排查未解决

解决Reanimated版本不匹配导致的触摸功能异常问题
  • 确认版本严格匹配
    查清楚当前使用的Expo SDK对应的react-native-reanimated精确版本(比如Expo SDK 49对应reanimated 3.3.0),执行指定版本安装命令:

    npm install react-native-reanimated@x.x.x
    # 或
    yarn add react-native-reanimated@x.x.x
    
  • 彻底清除缓存并重启

    • 清除包管理器缓存:npm cache clean --force 或 yarn cache clean
    • 清除Expo Metro缓存并重启项目:expo r -c
    • 若为裸React Native项目,重新安装iOS依赖:cd ios && pod install && cd ..,再重新运行项目
  • 检查Babel配置正确性
    确保babel.config.js中Reanimated插件放在最后一位:

    module.exports = {
      presets: ['babel-preset-expo'],
      plugins: ['react-native-reanimated/plugin'],
    };
    
  • 验证GestureHandler配置
    在项目入口文件(如App.js)最顶部导入并初始化GestureHandler:

    import 'react-native-gesture-handler';
    
  • 更新Expo Go客户端
    确保手机上的Expo Go应用是最新版本,与本地Expo SDK版本保持一致

内容的提问来源于stack exchange,提问作者heejung Kwon

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.01 07:41:29