Ver código fonte

Add back componentWillUnmount

Renée Kooi 6 anos atrás
pai
commit
53a362ecd8

+ 4 - 0
packages/@uppy/react/src/Dashboard.js

@@ -21,6 +21,10 @@ class Dashboard extends React.Component {
     }
     }
   }
   }
 
 
+  componentWillUnmount () {
+    this.uninstallPlugin()
+  }
+
   installPlugin () {
   installPlugin () {
     const uppy = this.props.uppy
     const uppy = this.props.uppy
     const options = Object.assign(
     const options = Object.assign(

+ 4 - 0
packages/@uppy/react/src/DashboardModal.js

@@ -22,6 +22,10 @@ class DashboardModal extends React.Component {
     }
     }
   }
   }
 
 
+  componentWillUnmount () {
+    this.uninstallPlugin()
+  }
+
   installPlugin () {
   installPlugin () {
     const uppy = this.props.uppy
     const uppy = this.props.uppy
     const options = Object.assign(
     const options = Object.assign(

+ 4 - 0
packages/@uppy/react/src/DragDrop.js

@@ -21,6 +21,10 @@ class DragDrop extends React.Component {
     }
     }
   }
   }
 
 
+  componentWillUnmount () {
+    this.uninstallPlugin()
+  }
+
   installPlugin () {
   installPlugin () {
     const uppy = this.props.uppy
     const uppy = this.props.uppy
     const options = Object.assign(
     const options = Object.assign(

+ 4 - 0
packages/@uppy/react/src/ProgressBar.js

@@ -21,6 +21,10 @@ class ProgressBar extends React.Component {
     }
     }
   }
   }
 
 
+  componentWillUnmount () {
+    this.uninstallPlugin()
+  }
+
   installPlugin () {
   installPlugin () {
     const uppy = this.props.uppy
     const uppy = this.props.uppy
     const options = Object.assign(
     const options = Object.assign(

+ 4 - 0
packages/@uppy/react/src/StatusBar.js

@@ -22,6 +22,10 @@ class StatusBar extends React.Component {
     }
     }
   }
   }
 
 
+  componentWillUnmount () {
+    this.uninstallPlugin()
+  }
+
   installPlugin () {
   installPlugin () {
     const uppy = this.props.uppy
     const uppy = this.props.uppy
     const options = Object.assign(
     const options = Object.assign(

+ 4 - 0
packages/@uppy/react/src/Wrapper.js

@@ -22,6 +22,10 @@ class UppyWrapper extends React.Component {
     }
     }
   }
   }
 
 
+  componentWillUnmount () {
+    this.uninstallPlugin()
+  }
+
   installPlugin () {
   installPlugin () {
     const plugin = this.props.uppy
     const plugin = this.props.uppy
       .getPlugin(this.props.plugin)
       .getPlugin(this.props.plugin)