diff --git a/src/index.js b/src/index.js index 1fd52cf..a13a660 100644 --- a/src/index.js +++ b/src/index.js @@ -30,7 +30,7 @@ export default class Lottie extends React.Component { this.registerEvents(eventListeners); } - componentWillUpdate(nextProps /* , nextState */) { + UNSAFE_componentWillUpdate(nextProps /* , nextState */) { /* Recreate the animation handle if the data is changed */ if (this.options.animationData !== nextProps.options.animationData) { this.deRegisterEvents(this.props.eventListeners); diff --git a/src/tests/index.js b/src/tests/index.js index e84bd42..a414df8 100644 --- a/src/tests/index.js +++ b/src/tests/index.js @@ -117,7 +117,7 @@ describe('react-lottie', () => { component.instance().registerEvents = registerEventsSpy; component.update(); - component.instance().componentWillUpdate({ + component.instance().UNSAFE_componentWillUpdate({ options: { ...defaultOptions, animationData: beatingHeart,