React Native使用FlashList报错:AutoLayoutView未在UIManager中找到
解决FlashList报错:requireNativeComponent: "AutoLayoutView" was not found in the UIManager
这个错误是因为FlashList的原生组件未正确注册,通常是依赖安装不完整或缓存问题导致的,按以下步骤解决:
重新安装依赖并清除包管理器缓存
- 删除本地依赖目录:
# 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
- 删除本地依赖目录:
清除React Native缓存并重启 Metro
npx react-native start --reset-cache重新构建原生项目
- iOS:
cd ios && pod install && cd .. && npx react-native run-ios - Android:
npx react-native run-android
- iOS:
另外注意,你设置的estimatedItemSize={15}数值过小,建议改为列表项的实际大致高度(比如150),否则可能出现布局偏移或滚动异常。
内容的提问来源于stack exchange,提问作者Mahdyar
相关产品推荐
相关产品推荐

