react navigation variable navigate

i have a flatlist and 5 items I want every item to navigate different pages but currently it gives me an error

 <FlatList style={{backgroundColor:'#ffffff'}}
    data={[{key: 'Book',details:'sssss',icon:'ios-calendar-outline',way:'Home'}]}
        renderItem={({item}) => <TouchableOpacity  onPress={() => navigate({item.way})}>

how can I pass {item.way} variable into navigate()

1 answer

  • answered 2018-01-13 17:14 kazimt9

    You have a syntax error here navigate({item.way}). Try: