Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. export const signOut = () => {
  2. const nav = NavigationActions.navigate({
  3. routeName: 'mainFlow', // It's navigation from drawer, so maybe I // don't need to specify this routeName?
  4. action: NavigationActions.navigate({ routeName: 'intro' })
  5. });
  6. return () => {
  7. try {
  8. AsyncStorage.clear();
  9. } finally {
  10. AsyncStorage.getItem('token').then(function (response) {
  11. console.log(response);
  12. });
  13. return nav;
  14. }
  15. }
  16.  
  17. };
  18.  
  19. componentDidMount() {
  20. this.props.getData();
  21. }
  22.  
  23. this.props.getData(this.props.navigation);
  24.  
  25. const getData =(navigation) => {
  26. navigation.navigate('ToYourScreen');
  27. ...
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement