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

Warning: Can't perform a React state update on an unmounted component. #6738

Open
2 of 4 tasks
chantal-kelm opened this issue Jun 3, 2024 · 2 comments
Open
2 of 4 tasks
Assignees
Labels
level/task Task issue type/bug Bug issue

Comments

@chantal-kelm
Copy link
Member

chantal-kelm commented Jun 3, 2024

Wazuh Rev Browser
4.9.0 00 -

Description

The application has a warning that is repeated many times throughout the application. We need to fix it.

Can't perform a React state update on an unmounted component.

Evidence image

image

image image

Tasks

  • Create a hook to fix the warning.
  • Creating unit tests
  • Use the hook in all functional components of the application.
  • Define the best way to solve the warning in class components

Additional information

Add here any additional information relevant to the issue or that will help to close it: chunks of code, logs, additional error messages, related issues and so on.

@chantal-kelm chantal-kelm added type/bug Bug issue level/task Task issue labels Jun 3, 2024
@chantal-kelm chantal-kelm self-assigned this Jun 3, 2024
@chantal-kelm chantal-kelm linked a pull request Jun 3, 2024 that will close this issue
6 tasks
@chantal-kelm
Copy link
Member Author

chantal-kelm commented Jun 5, 2024

After investigating why this happens in our application I saw that what happens is that for example if you are in a tab and you switch to another, when the component is unmounted there are asynchronous processes that are still running and that's when the application throws the warning ‘Cannot perform a React status update on a unmounted component’.

To solve this I created a hook to resolve the warning.
This hook will allow us to implement a global solution in the application to fix the warning.

@chantal-kelm
Copy link
Member Author

chantal-kelm commented Jun 6, 2024

IMPORTANT

This issue is still in progress, we will postpone it to the next stage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level/task Task issue type/bug Bug issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant