wazuh / wazuh-dashboard-plugins

Plugins for Wazuh Dashboard
https://wazuh.com/
GNU General Public License v2.0
415 stars 176 forks source link

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

Open chantal-kelm opened 1 month ago

chantal-kelm commented 1 month ago
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](https://github.com/wazuh/wazuh-dashboard-plugins/assets/124377319/66c99155-dbf6-4f84-a150-bf5a04ec74af) image image

Tasks

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 commented 1 month ago

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 commented 1 month ago

IMPORTANT

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