Skip to content

Instantly share code, notes, and snippets.

@grabbou
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grabbou/7a860fe69f842572effb to your computer and use it in GitHub Desktop.
Save grabbou/7a860fe69f842572effb to your computer and use it in GitHub Desktop.
// Some predefined animations for you usage
export const animations = {
layout: {
spring: {
duration: 500,
create: {
duration: 300,
type: LayoutAnimation.Types.easeInEaseOut,
property: LayoutAnimation.Properties.opacity
},
update: {
type: LayoutAnimation.Types.spring,
springDamping: 200
}
},
easeInEaseOut: {
duration: 300,
create: {
type: LayoutAnimation.Types.easeInEaseOut,
property: LayoutAnimation.Properties.scaleXY
},
update: {
delay: 100,
type: LayoutAnimation.Types.easeInEaseOut
}
}
}
};
const FormComponent = React.createClass({
componentWillUpdate(props, state) {
if (state.isKeyboardOpened !== this.state.isKeyboardOpened) {
LayoutAnimation.configureNext(animations.layout.spring);
}
}
// Please assume render is present ;)
});
return FormComponent;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment