我使用的是react-native-tab-view。我不确定这和这个错误有什么关系。
<TabView
bounces={false}
navigationState={this.state}
swipeEnabled={false}
renderScene={() => null}
renderTabBar={props => (
<TabBar
{...props}
indicatorStyle={{
backgroundColor: "#212121",
height: "100%",
width: "38%",
marginLeft: "5%"
}}
style={{ backgroundColor: "#FFD54F" }}
inactiveColor="#757575"
activeColor={"#212121"}
pressOpacity={0.9}
tabStyle={{
backgroundColor: "#FFD54F",
marginBottom: 3
}}
labelStyle={{ fontWeight: "bold" }}
/>
)}
onIndexChange={index => this.setState({ index })}
initialLayout={{
width: Dimensions.get("window").width
}}
/>
{pages}以上代码在更新前有效。
当我使用react-native-tab-view进入屏幕时出现此错误。
我怎么才能解决这个问题呢?
谢谢!

发布于 2020-02-07 17:36:47
这是版本问题。我刚刚重新安装了react-native-tab-view@2.11.0。它成功了!我希望这对其他人有用!
https://stackoverflow.com/questions/60014226
复制相似问题