Skip to content

Jest test failing: Cannot set property 'innerHTML' of undefined #22

@cailborg

Description

@cailborg

Seems like you need to implement the fix outlined here: airbnb/lottie-web#1772

Updating the componentWillUnmount function in the distro package temporarily fixed it for me

 Lottie.prototype.componentWillUnmount = function () {
        this.removeEventListeners(this.props.lottieEventListeners);
        this.animationItem.wrapper=this.animationItem.wrapper || {}  // <<Add this line
        this.animationItem.destroy(this.animationItem.wrapper);  // << Update this line
        this.config.animationData = null;
        this.config.path = null;
        this.animationItem = null;
    };

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions