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

How might I attach an onPress to goToPage(x)? #16

Closed
irfaan opened this issue Jul 16, 2015 · 2 comments
Closed

How might I attach an onPress to goToPage(x)? #16

irfaan opened this issue Jul 16, 2015 · 2 comments

Comments

@irfaan
Copy link
Contributor

irfaan commented Jul 16, 2015

I am trying to use a onPress from within a tab to switch tabs. Do you happen to know how I might access goToPage() in ScrollableTabView from within a tab? Is that the right function?

Thank you in advance!

@irfaan
Copy link
Contributor Author

irfaan commented Jul 16, 2015

Used a reference on ScrollableTabView to access goToPage().

<ScrollableTabView
    ref="ScrollableTabs" 
    ...
/>

[...]


<TouchableOpacity 
    onPress={
        event => this.refs.ScrollableTabs.goToPage(0)
    } 
>
[...]
</TouchableOpacity>

@irfaan irfaan closed this as completed Jul 16, 2015
@brentvatne
Copy link
Collaborator

Great :) Sorry for not getting back to you

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

No branches or pull requests

2 participants