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

Page keep blinking when move to third page #27

Open
Rookie91-ReactNative opened this issue Sep 7, 2019 · 5 comments
Open

Page keep blinking when move to third page #27

Rookie91-ReactNative opened this issue Sep 7, 2019 · 5 comments

Comments

@Rookie91-ReactNative
Copy link

Hi,

I'm new in React-Native.
I'm using the FlipY effect on my application.
Everythings running ok on Android version.
But when I tried to run on Ios version, when I navigate to the third page.
The page will keep blinking.

Example: Home Page > Login Page > Verification Page.

If I remove the effect, the page will not be blinking.

May I know how to solve this issue?
Thanks a lot

@karam1ashqar
Copy link

I have this issue too

@metahexane
Copy link

metahexane commented Sep 18, 2019

Experiencing the same issue on an iPhone 6s. The screen straightup flickers. I even see some traces of previous screens.

@CryceTruly
Copy link

Hey guys anyone working to fix this?

@darrenyaoyao
Copy link

darrenyaoyao commented Nov 8, 2019

I found the problem can be solved by adding opacity in transitionConfig.

  transitionSpec: {
    duration: 2000,
    easing: Easing.out(Easing.poly(4)),
    timing: Animated.timing,
    useNativeDriver: true
  },
  screenInterpolator: ({ position, scene }) => {
    const { index } = scene;
    const rotateY = position.interpolate({
      inputRange: [index - 1, index],
      outputRange: ["180deg", "0deg"]
    });

    const opacity = position.interpolate({
      inputRange: [index - 1, index, index + 1],
      outputRange: [0, 1, 0]
    });

    return {
      opacity,
      transform: [{ rotateY }],
      backfaceVisibility: "hidden"
    };
  }

@fawazahmed-makeen
Copy link

Excellent fix @darrenyaoyao

const flipY = duration => ({
  transitionSpec: {
    duration,
    easing: Easing.out(Easing.poly(4)),
    timing: Animated.timing,
    useNativeDriver: true
  },
  screenInterpolator: ({ position, scene }) => {
    const { index } = scene;
    const rotateY = position.interpolate({
      inputRange: [index - 1, index],
      outputRange: ["180deg", "0deg"]
    });

    const opacity = position.interpolate({
      inputRange: [index - 1, index, index + 1],
      outputRange: [0, 1, 0]
    });

    return {
      opacity,
      transform: [{ rotateY }],
      backfaceVisibility: "hidden"
    };
  }
});

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

6 participants