From 8af1d1ceb51409f81abe8511ec6e56253dd7aa3e Mon Sep 17 00:00:00 2001 From: Reinaldo Neto <47038980+reinaldonetof@users.noreply.github.com> Date: Fri, 18 Mar 2022 12:02:04 -0300 Subject: [PATCH] Chore: Migrate containers: Loading to Typescript (#3915) --- app/containers/Loading.tsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/app/containers/Loading.tsx b/app/containers/Loading.tsx index cd4ed285d..69cd6565a 100644 --- a/app/containers/Loading.tsx +++ b/app/containers/Loading.tsx @@ -22,15 +22,20 @@ interface ILoadingProps { theme?: string; } -class Loading extends React.PureComponent { +interface ILoadingState { + scale: Animated.Value; + opacity: Animated.Value; +} + +class Loading extends React.PureComponent { state = { scale: new Animated.Value(1), opacity: new Animated.Value(0) }; - private opacityAnimation: any; + private opacityAnimation?: Animated.CompositeAnimation; - private scaleAnimation: any; + private scaleAnimation?: Animated.CompositeAnimation; componentDidMount() { const { opacity, scale } = this.state; @@ -61,7 +66,7 @@ class Loading extends React.PureComponent { } } - componentDidUpdate(prevProps: any) { + componentDidUpdate(prevProps: ILoadingProps) { const { visible } = this.props; if (visible && visible !== prevProps.visible) { this.startAnimations(); @@ -107,8 +112,7 @@ class Loading extends React.PureComponent {