ptomasroos / react-native-tab-navigator

A tab bar that switches between scenes, written in JS for cross-platform support
MIT License
2.4k stars 416 forks source link

how to uninstall tab-navigator when i unload #135

Closed thiswhy closed 7 years ago

thiswhy commented 7 years ago

Hi man! I want to change user,so I go back to login,but tab-navigator doesn't uninstall ,so when I had login to tab-navigator pager,there are two tab-navigator component waiting for me ~~~hooly shit! How to solve this problem,online for waiting.....worry! My english is poor ,i'm sorry for wrony words.

thiswhy commented 7 years ago

thank you!I have an other way to save this question,just hide this tab in children view

ptomasroos commented 7 years ago

Make sure you only render one tab-navigator at a time sounds like the solution here, set a state variable when you're signed in and one when you're signed out. And depending on which state you're in draw either one of them. Sometimes you need to make sure to set a key on the element to avoid reuse. (applies to all components)