Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
atcaines opened this issue Jan 27, 2025 · 0 comments
Open

Comments

@atcaines
Copy link

atcaines commented Jan 27, 2025

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant