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

Tab's initialPage value is ignored in React Native #2368

Closed
laukaichung opened this issue Mar 5, 2018 · 6 comments
Closed

Tab's initialPage value is ignored in React Native #2368

laukaichung opened this issue Mar 5, 2018 · 6 comments

Comments

@laukaichung
Copy link

laukaichung commented Mar 5, 2018

Version

2.1.6

Environment

React Native

Reproduction link

https://github.com/ant-design/antd-mobile-samples/tree/master/rn-expo

Steps to reproduce

Open the RN demo in expo.

What is expected?

The content of second tab should be shown first when the value of initialPage is set to 1 in the demo.

What is actually happening?

There's a bug regarding initialPage in react native. You can see the bug in the expo demo for RN version.

Unlike the web version, when intiial page is set to 1, the content of the first tab is rendered and shown first even though the TabBar has the "Second Tab" highlight in blue.

@zhang740
Copy link
Contributor

zhang740 commented Mar 6, 2018

RN version? iOS or Android?

@laukaichung
Copy link
Author

@zhang740
On android.

@warmhug
Copy link
Contributor

warmhug commented May 25, 2018

It works properly in https://github.com/react-component/m-tabs . So it should work correctly in your project.
Maybe it is affected by other components in antd-mobile ? cc @silentcloud

@warmhug
Copy link
Contributor

warmhug commented May 29, 2018

Close for #2556 (comment)

@huandie2012
Copy link

我也遇到了相似的问题

@huandie2012
Copy link

在页面不刷新的情况下,及时render已经重新渲染了,initialPage的值还是不变,导致tab-active不能回到初始位置

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

4 participants