Browse Source

react-example: Initialize Uppy instances in constructor

Renée Kooi 6 năm trước cách đây
mục cha
commit
630bdecc05
1 tập tin đã thay đổi với 2 bổ sung4 xóa
  1. 2 4
      examples/react-example/App.js

+ 2 - 4
examples/react-example/App.js

@@ -14,16 +14,14 @@ module.exports = class App extends React.Component {
       open: false
     }
 
-    this.handleModalClick = this.handleModalClick.bind(this)
-  }
-
-  componentWillMount () {
     this.uppy = new Uppy({ id: 'uppy1', autoProceed: true, debug: true })
       .use(Tus, { endpoint: 'https://master.tus.io/files/' })
       .use(GoogleDrive, { serverUrl: 'https://companion.uppy.io' })
 
     this.uppy2 = new Uppy({ id: 'uppy2', autoProceed: false, debug: true })
       .use(Tus, { endpoint: 'https://master.tus.io/files/' })
+
+    this.handleModalClick = this.handleModalClick.bind(this)
   }
 
   componentWillUnmount () {