React-native-modal: How to do fade in fade out animation?

Created on 12 Jul 2017  路  4Comments  路  Source: react-native-modal/react-native-modal

Hi, any idea to better fade in and fade out? i didn't find the reference for fade animation so now we are currently modified the animations.js with fadeIn and fadeOut entry that modify opacity props like this

function makeFadeTransition(transitionType, fromValue, toValue){
  return {
    from: {
      [transitionType]: fromValue,
    },
    to: {
      [transitionType]: toValue,
    },
  };
}
export const fadeIn = makeFadeTransition('opacity', 0, 1);

export const fadeOut = makeFadeTransition('opacity', 1, 0);

Most helpful comment

Hi @JuniusAng
isn't setting this enough?

animationIn={'fadeIn'}
animationOut={'fadeOut'}

All 4 comments

Hi @JuniusAng
isn't setting this enough?

animationIn={'fadeIn'}
animationOut={'fadeOut'}

so actually we do not need to add another entry manually? my bad, i should tried to do that in different way before submitting an issue.

No worries man, glad it works.
You can take a look at react-native-animatable for all the available animations (it was at the bottom of the README.md).

Hi @JuniusAng
isn't setting this enough?

animationIn={'fadeIn'}
animationOut={'fadeOut'}

It works, even though in the documentation of react-native-modal or in the code we can't find it. I think anything from react-native-animatable works since they have used that. I went through some.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JoeCMorgan picture JoeCMorgan  路  3Comments

psycura picture psycura  路  4Comments

abdulrahman-khankan picture abdulrahman-khankan  路  4Comments

ShaikhKabeer picture ShaikhKabeer  路  3Comments

matheusrezende picture matheusrezende  路  4Comments