Selaa lähdekoodia

DownloadScreenshotControls: componentWillUnmount

This should solve the error:

Warning: Can't perform a React state update on an unmounted component.
This is a no-op, but it indicates a memory leak in your application.
To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.
Simeon Borko 2 vuotta sitten
vanhempi
commit
21f910a3ca
1 muutettua tiedostoa jossa 1 lisäystä ja 0 poistoa
  1. 1 0
      src/mol-plugin-ui/viewport/screenshot.tsx

+ 1 - 0
src/mol-plugin-ui/viewport/screenshot.tsx

@@ -58,6 +58,7 @@ export class DownloadScreenshotControls extends PluginUIComponent<{ close: () =>
     }
 
     componentWillUnmount() {
+        super.componentWillUnmount();
         this.setState({ imageData: void 0 });
     }