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: Props) {
const { direction, play } = this.props;
if (direction !== prevProps.direction && play === true) {
lottie.setDirection(direction === 'forward' ? 1 : -1);
lottie.play();
}
if (play !== prevProps.play && play === true) {
lottie.play();
}
}