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

ViewPagerAndroid renders empty views after upgrading react-native from 0.42.3 to 0.43.4. #13778

Closed
linamm opened this issue May 4, 2017 · 6 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@linamm
Copy link

linamm commented May 4, 2017

Description

I have passed an array of views as children views of the ViewPagerAndroid, when swiping the view pager, I expect the children view will be display one after another. Instead, only the first two views displayed as expected initially, the third view and onwards are empty. When I swipe back to the first view, the first view became empty too. I only start to see this problem after upgrading react-native from 0.42.3 to 0.43.4.

Reproduction Steps and Sample Code

const numbers = [1,2,3,4, 5]; 
const pages = numbers.map((number) => {
   return <Text>{number}</Text>
});
 <ViewPagerAndroid style={{flex: 1}}>
    {pages}
</ViewPagerAndroid>

Solution

No idea.

Additional Information

  • React Native version: 0.43.4
  • Platform: Android
  • Development Operating System: MacOS
  • Dev tools: Android studio 1.5.1
@linamm linamm changed the title ViewPagerAndroid renders empty views after upgrade react-native from 0.42.3 to 0.43.4. ViewPagerAndroid renders empty views after upgrading react-native from 0.42.3 to 0.43.4. May 4, 2017
@whoyawn
Copy link

whoyawn commented May 6, 2017

Are you declaring numbers and pages in the render function? I had a similar problem for horizontal Flatlists too. #13386

@whoyawn
Copy link

whoyawn commented May 8, 2017

I tried recreating your problem in version 0.44.0, and there weren't any problems. I get these warnings though, so that could be the problem:

Each ViewPager child must be a <View>. Was Text
Warning: Each child in an array or iterator should have a unique "key" prop.

@linamm
Copy link
Author

linamm commented May 8, 2017

Hi, @HuyAnhh, thank you very much for trying this out! The ViewPagerAndroid is indeed working fine with 0.43.4 as well, I had other layout problem in my code, which is causing this. So, closing this issue now. Thanks again! 👍

@linamm linamm closed this as completed May 8, 2017
@walfud
Copy link

walfud commented Nov 2, 2017

@linamm I had the same problem even I put child within a View component. How you solved the problem?

@linamm
Copy link
Author

linamm commented Nov 3, 2017

Hi, Walfud, I cannot remember the details now, I think I've used scrollview instead in the end.

@walfud
Copy link

walfud commented Nov 4, 2017

@linamm Thanks

@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants