Browse Source

react: Use two different instances for Dashboard and DashboardModal examples

Renée Kooi 7 years ago
parent
commit
43085e6b3c
1 changed files with 6 additions and 1 deletions
  1. 6 1
      examples/react-example/App.js

+ 6 - 1
examples/react-example/App.js

@@ -20,10 +20,15 @@ module.exports = class App extends React.Component {
     this.uppy = new Uppy({ autoProceed: false })
       .use(Tus10, { endpoint: 'https://master.tus.io/files' })
       .run()
+
+    this.uppy2 = new Uppy({ autoProceed: false })
+      .use(Tus10, { endpoint: 'https://master.tus.io/files' })
+      .run()
   }
 
   componentWillUnmount () {
     this.uppy.close()
+    this.uppy2.close()
   }
 
   handleModalClick () {
@@ -61,7 +66,7 @@ module.exports = class App extends React.Component {
             {this.state.open ? 'Close dashboard' : 'Open dashboard'}
           </button>
           <DashboardModal
-            uppy={this.uppy}
+            uppy={this.uppy2}
             open={this.state.open}
             onRequestClose={() => this.setState({ open: false })}
           />