Skip to content

Function Invocation After Component Unmount – Request for Clarification and Cleanup Functions #145

@YukoIshikawa

Description

@YukoIshikawa

Hi,

I've encountered an issue where a function within the library continues to be called even after the parent component unmounts. This appears to be related to improper cleanup of event listeners, callbacks, or subscriptions when the component is removed from the DOM.

Specifically, I'm receiving the following error: "Failed to execute 'showPopover' on 'HTMLElement': Invalid on disconnected popover elements. InvalidStateError: Failed to execute 'showPopover' on 'HTMLElement': Invalid on disconnected popover elements."

Could you please help clarify the following:
• Why might the function be invoked after the component has been unmounted?
• Does the library offer any built-in cleanup functions (e.g., detach, cancel, or similar methods) to deregister event listeners or callbacks when the component is unmounted?
• Are there any recommended best practices or additional steps we should take to prevent this issue when using the library?

Any insights you can provide would be greatly appreciated, as they will help us effectively troubleshoot and resolve this behavior.

Thank you for your assistance.

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