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

[Bug] issue with React StrictMode causing Dataset table to not display #2685

Open
Ritesh9876 opened this issue Oct 11, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@Ritesh9876
Copy link

Describe the bug
When clicking the "View Data Table" button in a React or Next.js application while using Strict Mode, the dataset table is not visible. This issue occurs because this.setState is set to an empty function in the componentDidUnmount lifecycle method.

In Strict Mode, componentDidUnmount is called at the start (detect potential issues), which causes this.setState to be set as an empty function prematurely. As a result, any subsequent calls to setState do not change the state of the component.

The issue has been fixed by introducing a hasMounted flag to ensure that setState is only called when the component is mounted.

A similar issue occurs when the data table is visible, and the three vertical dots near each column are clicked. In Strict Mode, the dropdown menu does not appear.

To Reproduce
Steps to reproduce the behavior:

  1. Go to examples/demo-app/src/main.js or create a new React/Next.js application.
  2. Wrap the component in React.StrictMode.
  3. Open the application in the browser, upload a dataset, and click the "View Data Table" button.
  4. Observe that the dataset table is blank.

I have raised PR for this issue: #2683

Screenshots
kepler_dataset_issue

Expected behavior
The dataset table should be visible, and the dropdown near each column name should be functional in Strict Mode.

Desktop :

OS: Ubuntu
Browser: Chrome, firefox
Version: Ubuntu 24.04.1 LTS

@Ritesh9876 Ritesh9876 added the bug Something isn't working label Oct 11, 2024
@Ritesh9876
Copy link
Author

Hi, @ibgreen @igorDykhta I would really appreciate your help with this issue. I have described the problem and the steps to reproduce it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant