oblador / react-native-animatable

Standard set of easy to use animations and declarative transitions for React Native
MIT License
9.81k stars 702 forks source link

Animation working problem with Hooks #341

Open ahtisham09 opened 3 years ago

ahtisham09 commented 3 years ago

Hello Everyone i hope you are doing well i am facing problem from couple of days when i open app the animation move more then 3 times i search a lot of things but nothing works around

const [expand, setExpand] = React.useState(false);

React.useEffect(() => { setTimeout(() => { setExpand(!expand); }, 5000); }, [profile]);

`{expand && (
<Animatable.View animation="fadeInUp" useNativeDriver={true} direction="alternate" easing="linear"

<FlatList data={recommendedCourses} renderItem={({item}) => <Courses item={item} {...props} />} /> </Animatable.View>)} `

mifi commented 3 years ago

im guessing profile changes causing it to re-mount

ahtisham09 commented 3 years ago

@mifi this hooks work only when profile change