Skip to content

Event Target Lookup Error if data prop is updated caused by re-used ref #298

@atcaines

Description

@atcaines

Due to the handling of the tabulator ref, if the data prop is updated it leads to re-instantiating the Tabulator instance on the same DOM element without cleaning up the previous ref with .destroy(). See here: https://github.com/ngduc/react-tabulator/blob/master/src/ReactTabulator.tsx#L75. The ref is only cleaned up in the "unmount" useEffect, but it is re-used on subsequent calls to initTabulator.

This leads to a console warning on any events:

Image

This can be reproduced on the codesandbox linked in the repo by triggering the "Asynchronous data" Set Data button then triggering a mouse event by double clicking a row in the table.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions