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

[v7][iOS] waitForRender is broken #7457

Closed
sintylapse opened this issue Feb 12, 2022 · 3 comments · Fixed by #7768
Closed

[v7][iOS] waitForRender is broken #7457

sintylapse opened this issue Feb 12, 2022 · 3 comments · Fixed by #7768

Comments

@sintylapse
Copy link

sintylapse commented Feb 12, 2022

🐛 Bug Report

On version starting from 7.24.3, when you push in a heavy screen or from a heavy screen and waitForRender is enabled (or disabled, doesn't matter), for a split second the whole screen is render inside 0 pixels in the left top corner of a screen, and you can see only views that have hardcoded width and height. So the only way to workaround this bug is to add is to add this style to the root view of the screen

<View style={{
      width: Dimensions.get('window').width,
      height: Dimensions.get('window').height,
    }}>

Have you read the Contributing Guidelines on issues?

yes

To Reproduce

  1. Setup Playground project
  2. Inside src/screens/PushedScreen.tsx add this component to make the screen heavy
<FlatList
          data={Array(500)
            .fill(null)
            .map((_, index) => ({
              id: index,
              title: `Item title ${index}`,
              description: `Item description ${index}`,
            }))}
          renderItem={({ item: { id, title, description } }) => (
            <View key={id}>
              <Text>{title}</Text>
              <Text>{description}</Text>
            </View>
          )}
        />
  1. Change src/components/Root.tsx Root component to
const Root = ({ children, componentId, footer, style, testID, onLayout }: RootProps) => (
  <View style={{ flex: 1, backgroundColor: 'green' }}>
    {children}
  </View>
);
  1. Add waitForRender option to src/commons/options/Options.ts
animations: {
      push: {
        waitForRender: true,
      },
    },
  1. Start Playground project and go to Stack -> Push -> Push
  2. Observe weird flickering and for a split second only items with hardcoded height are rendered

Expected behavior

All screen should be rendered without jumping and flickering

Actual Behavior

Weird flickering and for a split second only items with hardcoded height are rendered

Your Environment

  • React Native Navigation version: 7.25.3
  • React Native version: 0.66.3
  • Platform(s) (iOS, Android, or both?): iOS
  • Device info (Simulator/Device? OS version? Debug/Release?): iPhone 13, iOS 15

Reproducible Demo

https://github.com/sintylapse/react-native-navigation/tree/broken-waitforrender-demo

Screen.Recording.2022-02-12.at.16.46.34.mov

Screen Shot 2022-02-12 at 17 07 16

Are you willing to resolve this issue by submitting a Pull Request?

  • ✖️   Yes, I have the time, and I know how to start.
  • ✅   Yes, I have the time, but I don't know how to start. I would need guidance.
  • ✖️   No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.
@sintylapse
Copy link
Author

on version 7.24.2 everything is fine

@ItsNoHax
Copy link
Collaborator

Seems to be related to: 345344a

Any idea why that code would cause this @yogevbd ?

As a temporary solution I used patch-package to revert that commit for our app.

@yogevbd
Copy link
Collaborator

yogevbd commented Feb 16, 2022

Will investigate this soon. I'm currently working on stabilizing Android.

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

Successfully merging a pull request may close this issue.

3 participants