问题描述
使用react-native-scrollable-tab-view 中的滑动组件 ScrollableTabBar 出错:
ERROR Error: Element ref was specified as a string (tabContainer) but no owner was set. This could happen for one of the following reasons:
1. You may be adding a ref to a function component
2. You may be adding a ref to a component that was not created inside a component's render method
3. You have multiple copies of React loaded
See https://reactjs.org/link/refs-must-have-owner for more information.
谷歌搜了下应该是第三个描述:多个文件冲突了
解决方案
参考文章
直接下载npm i --legacy-peer-deps
搞定!