Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined is not an object (evaluating'state.routes[childIndex]') #3029

Closed
Shabnam-Veranloo opened this issue May 12, 2018 · 1 comment
Closed

Comments

@Shabnam-Veranloo
Copy link

i have a view that inside this view have router for tabs(tabs in under image in this view ),i want put this view inside other tab with other router
when run app this erorr show to me => undefined is not an object (evaluting 'state.routes[childIndex]'
my cod:

for fist view
const MyCoupon = () => {

return(

<View>
<Image ..../>
 <RouterTabCopon  />
</View>

);
};

fire tab that inside view:

const RouterTabCopon = () => {
return (

        <Scene
        key="tab11"
        tabs={true}
        swipeEnabled={false}
        gestureEnabled ={true}
        lazyLoad= {true}
        tabBarPosition='top'
        labelStyle={{fontSize:16}}
        tabBarStyle={{ backgroundColor: '#373c4a',height:60 }}
        indicatorStyle={{ backgroundColor: '#ff6600', height:6 }}>

        <Scene
        key="tab1"
        tabs={true}
        swipeEnabled={false}
        gestureEnabled ={true}
        lazyLoad= {true}
        tabBarPosition='top'
        tabBarComponent={CopounTab}
        labelStyle={{ color: '#ff3300' ,fontSize:18}}
        tabBarStyle={{ backgroundColor: '#fff',height:60 }}
        indicatorStyle={{ height:0 }}>

          <Scene key="tab11" component={ViewInTabGift} hideNavBar={true} showLabel={true} labelStyle={{ color: '#000000' }} />
          <Scene key="tab12" component={ViewInTabGift} hideNavBar={true}  showLabel={true} labelStyle={{ color: '#000000' }}/>
          <Scene key="tab13" component={ViewInTabGift} hideNavBar={true}  showLabel={true} labelStyle={{ color: '#000000' }}/>
        </Scene >
        <Scene
        key="tab2"
        tabs={true}
        swipeEnabled={false}
        gestureEnabled ={true}
        lazyLoad= {true}
        tabBarPosition='top'
        tabBarComponent={CopounTabTwo}
        labelStyle={{ color: '#ff3300',fontSize:18 }}
        tabBarStyle={{ backgroundColor: '#fff',height:60 }}
        indicatorStyle={{ height:0 }}>

          <Scene key="tab21" component={ViewInTabStuff} hideNavBar={true} showLabel={true} labelStyle={{ color: '#000000' }}/>
          <Scene key="tab22" component={ViewInTabStuff} hideNavBar={true}  showLabel={true} labelStyle={{ color: '#000000' }}/>
        </Scene >
        <Scene  {...this.state}
        key="tab3"
        tabs={true}
        swipeEnabled={false}
        gestureEnabled ={true}
        lazyLoad= {true}
        labelStyle={{ color: '#ff3300',fontSize:18 }}
        tabBarPosition='top'
        initial={true}
        tabBarComponent={CopounTab}
        tabBarStyle={{ backgroundColor: '#fff',height:60 }}
        indicatorStyle={{ height:0 }}>

          <Scene key="tab31" component={Viewintab} hideNavBar={true} showLabel={true} labelStyle={{ color: '#000000' }}/>
          <Scene key="tab32" component={Viewintab} hideNavBar={true}  showLabel={true} labelStyle={{ color: '#000000' }}/>
          <Scene key="tab33" component={Viewintab} hideNavBar={true}  showLabel={true} labelStyle={{ color: '#000000' }}/>
        </Scene >

      </Scene >


  </Router>

);
};

tabs that i want put view inside

const MainRouter = () => {

return (

        <Scene
        key="tab1155"
        tabs={true}
        swipeEnabled={false}
        gestureEnabled ={true}
        lazyLoad= {true}
        tabBarPosition='top'
        labelStyle={{fontSize:16}}
        tabBarStyle={{ backgroundColor: '#373c4a',height:60 }}
        indicatorStyle={{ backgroundColor: '#ff6600', height:6 }}>


          <Scene key="tab11555" component={ViewThree} hideNavBar={true} showLabel={true} labelStyle={{ color: '#000000' }} />
          <Scene key="tab1255" component={ViewThree} hideNavBar={true}  showLabel={true} labelStyle={{ color: '#000000' }}/>
          <Scene key="tab13555" component={MyCoupon} hideNavBar={true}  showLabel={true} labelStyle={{ color: '#000000' }}/>



      </Scene >


  </Router>

);
};

@Shabnam-Veranloo Shabnam-Veranloo changed the title undefined is not an object (evaluating'state.routes[childIndex]' undefined is not an object (evaluating'state.routes[childIndex]') May 12, 2018
@aksonov
Copy link
Owner

aksonov commented Aug 8, 2018

Please try to reproduce it with Example project and latest version 4.0.0-beta.40. Feel free to open if the issue still exists

@aksonov aksonov closed this as completed Aug 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants