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.
This commit is contained in:
parent
4409bbabb7
commit
5cb4bec633
|
@ -64,17 +64,24 @@ export default class CircularLabel extends AbstractCircularLabel<Props, State> {
|
||||||
this.state = {
|
this.state = {
|
||||||
pulseAnimation: new Animated.Value(0)
|
pulseAnimation: new Animated.Value(0)
|
||||||
};
|
};
|
||||||
|
|
||||||
this._maybeToggleAnimation({}, props);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implements {@code Component#componentWillReceiveProps}.
|
* Implements {@code Component#componentDidMount}.
|
||||||
*
|
*
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
*/
|
*/
|
||||||
componentWillReceiveProps(newProps: Props) {
|
componentDidMount() {
|
||||||
this._maybeToggleAnimation(this.props, newProps);
|
this._maybeToggleAnimation({}, this.props);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implements {@code Component#componentDidUpdate}.
|
||||||
|
*
|
||||||
|
* @inheritdoc
|
||||||
|
*/
|
||||||
|
componentDidUpdate(prevProps: Props) {
|
||||||
|
this._maybeToggleAnimation(prevProps, this.props);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue