Search code examples
react-nativereact-routerreact-native-router-fluxnative-base

ListItem onPress not finding key


I'm using React Native with react-native-router-flux and native-base. I have created a SideMenu with native -base and navigate with react-native-router-flux. The problem is that when i click to ListItem it does not navigate to the screen i want.

  • const datas = [ { name: 'Home', key: 'home', icon: 'home', bg: '#C5F442',

    }, { name: 'Profile', key:'profile', icon: 'user-circle-o', bg: '#477EEA', types: '8', }`

    *

            onPress={() =>{Actions.data.key()}}> 
    
              <Icon active name={data.icon} style={styles.icon} />
              <Text style={styles.text}>{data.name}</Text>
    
    
          </ListItem>}
      />
    
    
    
                   The declaration of scene
                      <Scene key='profile'
                            component={Profile} 
                            title='Profile' 
                            hideNavBar={true} 
                            tabs={true} />
    

Solution

  • If you really want make this in that way:

    Actions[data.key]({})