React native 反应本机选项卡视图-don';在单击“渲染”选项卡之前,不要渲染它

React native 反应本机选项卡视图-don';在单击“渲染”选项卡之前,不要渲染它,react-native,react-native-tab-view,React Native,React Native Tab View,在react native tab view中是否存在在选项卡可见/单击之前不呈现该选项卡的情况 链接:如果有帮助,我会这样做: renderScene = ({ route }) => { if (route.key == 'scene0' && this.state.index == 0) { return <Scene0 />; } if (route.key == 'scene1' && this.state.index == 1)

在react native tab view中是否存在在选项卡可见/单击之前不呈现该选项卡的情况


链接:

如果有帮助,我会这样做:

renderScene = ({ route }) => {
if (route.key == 'scene0' && this.state.index == 0) {
  return <Scene0 />;
}
if (route.key == 'scene1' && this.state.index == 1) {
  return <Scene1 />;
}
if (route.key == 'scene2' && this.state.index == 2) {
  return <Scene2 />;
}
renderScene=({route})=>{
if(route.key='scene0'&&this.state.index==0){
返回;
}
if(route.key='scene1'&&this.state.index==1){
返回;
}
if(route.key='scene2'&&this.state.index==2){
返回;
}
这允许我做的是控制何时安装组件,这仅在屏幕处于活动状态时才进行