0

So I'm trying to destroy the animation in my react app but it is not destroying if I use any event listener I get the errors I don't know why, here is the code

  import React, { Component } from 'react';
  import './Cool.css';
  import data from './data.json';
  import ReactBodymovin from 'react-bodymovin';

  class AventadorPage extends Component {
  render() {

    var bodymovinOptions = {
        loop: 2,
        autoplay: true,
        prerender: true,
        animationData: data,
    }

    return (
        <div id="main-container">
            <div className="animation">
                <ReactBodymovin options={bodymovinOptions} />
            </div>
        </div>
    );
}
}

export default AventadorPage;
Muhammad Usman
  • 135
  • 3
  • 9
  • Could you include the error you are getting, and the ways you have tried to destroy it so far? – Tholle Jul 08 '18 at 18:37
  • So I was resently using this in my code `var anim = ReactBodymovin.loadAnimation(bodymovinOptions); anim.addEventListener('loopComplete', function(e) { console.log("okay"); });` and the error was this TypeError: __WEBPACK_IMPORTED_MODULE_3_react_bodymovin___default.a.loadAnimation is not a function – Muhammad Usman Jul 08 '18 at 18:39

0 Answers0