Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentDidUpdate(prevProps) {
const { animations } = this.props;
const { animations: prevAnimations } = prevProps;
if (animations && !isEqual(animations, prevAnimations)) {
if (prevAnimations && prevAnimations.length) {
this.destroyAnimations(prevAnimations);
}
lottie.setQuality(2);
this.renderAnimations(animations);
}
}
componentDidMount() {
lottie.setQuality(2);
this.animations = {};
const { animations } = this.props;
if (animations && animations.length) {
this.renderAnimations(animations);
}
}