From 5cb4bec633bf6c29191fd80f214e59d46831491e Mon Sep 17 00:00:00 2001 From: Leonard Kim Date: Fri, 2 Nov 2018 14:48:03 -0700 Subject: [PATCH] ref(circular-label): animate after dom updates Based on react-native docs, looks like animations should be started after mount. Updating animation states I'm not certain on so I moved it to componentDidUpdate and tested with the live streaming label to ensure the component still animated fine. --- .../label/components/CircularLabel.native.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/react/features/base/label/components/CircularLabel.native.js b/react/features/base/label/components/CircularLabel.native.js index 864ac7694..6b6c5cd28 100644 --- a/react/features/base/label/components/CircularLabel.native.js +++ b/react/features/base/label/components/CircularLabel.native.js @@ -64,17 +64,24 @@ export default class CircularLabel extends AbstractCircularLabel { this.state = { pulseAnimation: new Animated.Value(0) }; - - this._maybeToggleAnimation({}, props); } /** - * Implements {@code Component#componentWillReceiveProps}. + * Implements {@code Component#componentDidMount}. * * @inheritdoc */ - componentWillReceiveProps(newProps: Props) { - this._maybeToggleAnimation(this.props, newProps); + componentDidMount() { + this._maybeToggleAnimation({}, this.props); + } + + /** + * Implements {@code Component#componentDidUpdate}. + * + * @inheritdoc + */ + componentDidUpdate(prevProps: Props) { + this._maybeToggleAnimation(prevProps, this.props); } /**