What's the best way to hide a tab in a TabNavigator?

后端 未结 3 1367
时光取名叫无心
时光取名叫无心 2021-02-15 05:26

I\'d like to conditionally hide a tab in a TabNavigator. It seems that setting visible doesn\'t work properly (presumably because this is how the TabNavigator hides the tabs th

3条回答
  •  旧时难觅i
    2021-02-15 06:00

    What do you mean by hide? If you actually mean remove, then just take your array that's bound to the data in the TabNavigator, and remove the applicable element from it.

    If you want to just have them removed temporarily, create a component of your own that encapsulates the TabNavigator and has an array of removed tabs and an array of actual tabs. Then handle this as you see fit.

提交回复
热议问题