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

React Native使用FlashList报错:AutoLayoutView未在UIManager中找到

解决FlashList报错:requireNativeComponent: "AutoLayoutView" was not found in the UIManager

这个错误是因为FlashList的原生组件未正确注册,通常是依赖安装不完整或缓存问题导致的,按以下步骤解决:

  1. 重新安装依赖并清除包管理器缓存

    • 删除本地依赖目录:
      # Mac/Linux
      rm -rf node_modules
      # Windows
      rd /s /q node_modules
      
    • 清除包管理器缓存:
      # npm
      npm cache clean --force
      # yarn
      yarn cache clean
      
    • 重新安装依赖:
      npm install
      # 或
      yarn install
      
  2. 清除React Native缓存并重启 Metro

    npx react-native start --reset-cache
    
  3. 重新构建原生项目

    • iOS:
      cd ios && pod install && cd .. && npx react-native run-ios
      
    • Android:
      npx react-native run-android
      

另外注意,你设置的estimatedItemSize={15}数值过小,建议改为列表项的实际大致高度(比如150),否则可能出现布局偏移或滚动异常。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.22 02:09:09