Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In react-navigation TabNavigator, how to setParams

const AppTabs = TabNavigator({
Home: {
  screen: FilmList,
},
FilmCinemaList: {
  screen: FilmCinemaList,
  path: 'cart',
},
FilmGoodsList: {
    screen: FilmGoodsList,
},
FilmMe: {
    screen: FilmMe,
},
})

when I click FilmCinemaList, i wanna pass a params. how to use setParams?

like image 977
Ann Avatar asked Apr 16 '26 23:04

Ann


1 Answers

You can pass the params this way when rendering your AppTabs:

<AppTabs screenProps={{ FilmCinemaList: { ...yourParams } }}/>

And you can access them on FilmCinemaList by:

this.props.screenProps.FilmCinemaList

.

like image 162
nirsky Avatar answered Apr 21 '26 09:04

nirsky