Skip to content

Instantly share code, notes, and snippets.

@fernandatoledo
Last active July 1, 2020 16:40
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 fernandatoledo/2517b07980cedf95b27a26b70f91bbd7 to your computer and use it in GitHub Desktop.
Save fernandatoledo/2517b07980cedf95b27a26b70f91bbd7 to your computer and use it in GitHub Desktop.
import React from 'react';
import {View, Animated} from 'react-native';
import useAnimate from 'hooks/useAnimate';
const AnimatedView = () => {
const animatedOpacity = useAnimate({
// fromValue: 0, (default)
// toValue: 1, (default)
duration: 1000,
});
return (
<Animated.View
style={{
height: 100,
widht: 100,
opacity: animatedOpacity.animatedValue,
backgroundColor: 'yellow',
}}
/>
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment