Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: goToPage of Tabs #203

Merged
merged 1 commit into from
Sep 30, 2016
Merged

fix: goToPage of Tabs #203

merged 1 commit into from
Sep 30, 2016

Conversation

nyablo
Copy link
Contributor

@nyablo nyablo commented Sep 27, 2016

@nyablo
Copy link
Contributor Author

nyablo commented Sep 27, 2016

@sanketsahusoft Take a look on this, plz

@sanketsahu
Copy link
Collaborator

@NazarYablonskiy Do you have a use-case example for the same?

@nyablo
Copy link
Contributor Author

nyablo commented Sep 27, 2016

@sanketsahusoft I'm sorry. I don't understand your question. What do you mean?

In my app I need to change a tab programmatically. I made a small changes to make it possible to do that.

@sanketsahu
Copy link
Collaborator

@NazarYablonskiy How do you use this feature? I am asking for an example so that we can document this.

@nyablo
Copy link
Contributor Author

nyablo commented Sep 28, 2016

@sanketsahusoft

import React, {Component} from 'react';
import {Tabs, Text, View} from 'native-base';

export default class MyComponentWithTabs extends Component {

  someEventHnadler() {
    this._tabs.goToPage(0);
  }

  ...

  render() {
    ...
    return (
      ...
      <Tabs ref={(c) => {this._tabs = c;}}>
        <View tabLabel="Tab 1">
          <Text>Tab 1</Text>
        </View>
        <View tabLabel="Tab 2">
          <Text>Tab 2</Text>
        </View>
      </Tabs>
      ...
    );
  }
}

@sankhadeeproy007 sankhadeeproy007 merged commit 3253fe8 into GeekyAnts:master Sep 30, 2016
@sankhadeeproy007
Copy link
Contributor

Thanks a lot @NazarYablonskiy !

@phixtalk
Copy link

Thanks for this, but i have a rather different case though, the above code works when the button link to navigate is in the same component as the tab, but i have a button link inside another component called from the main tab component. Please how do i bind this to work. thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants