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

goToPage and initialPage #776

Closed
yotavm opened this issue Oct 29, 2017 · 6 comments
Closed

goToPage and initialPage #776

yotavm opened this issue Oct 29, 2017 · 6 comments

Comments

@yotavm
Copy link

yotavm commented Oct 29, 2017

hi,
I'm working with the last version
I'm using the ScrollableTabBar
when I change the initial page the tabs work fine
its move to the initial page but the page is blank
and if I'm using goToPage with ref only the color of the text change and but
the page not change and the underline not move

@anthonied
Copy link

facebook/react-native#15808 - this fixed it for me

@skv-headless
Copy link
Collaborator

dup #750

@kubilaytural
Copy link

Try this. It worked. Ideal for changing first pages.

componentDidMount() {
setTimeout(() => this.scrollableTabView.goToPage(1), 300);
}
...
.....
...
<ScrollableTabView
ref={(ref) => { this.scrollableTabView = ref; }}

@lichao2018
Copy link

how to fix this.
gotoPage cannot re-render.

@buxiaoxia
Copy link

how to fix this.
gotoPage cannot re-render.

延迟300ms

@hz-sanaullah
Copy link

hz-sanaullah commented Sep 18, 2023

Try this. It worked. Ideal for changing first pages.

componentDidMount() { setTimeout(() => this.scrollableTabView.goToPage(1), 300); } ... ..... ... <ScrollableTabView ref={(ref) => { this.scrollableTabView = ref; }}

Sounds weird but it'll even work fine if the delay is 0ms like this "setTimeout(() => this.scrollableTabView.goToPage(1), 0);" 😄

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

7 participants