Prechádzať zdrojové kódy

Updated sample code to real code (#1864)

Behnam Mohammadi 5 rokov pred
rodič
commit
fd1d1a24b0
1 zmenil súbory, kde vykonal 5 pridanie a 4 odobranie
  1. 5 4
      website/src/docs/react.md

+ 5 - 4
website/src/docs/react.md

@@ -31,9 +31,10 @@ Instead of adding a UI plugin to an Uppy instance with `.use()`, the Uppy instan
 All other props are passed as options to the plugin.
 All other props are passed as options to the plugin.
 
 
 ```js
 ```js
-const Uppy = require('@uppy/core')
-const Tus = require('@uppy/tus')
-const { DragDrop } = require('@uppy/react')
+import React from 'react'
+import Uppy from '@uppy/core'
+import Tus from '@uppy/tus'
+import { DragDrop } from '@uppy/react'
 
 
 const uppy = Uppy({
 const uppy = Uppy({
   meta: { type: 'avatar' },
   meta: { type: 'avatar' },
@@ -46,7 +47,7 @@ uppy.use(Tus, { endpoint: '/upload' })
 uppy.on('complete', (result) => {
 uppy.on('complete', (result) => {
   const url = result.successful[0].uploadURL
   const url = result.successful[0].uploadURL
   store.dispatch({
   store.dispatch({
-    type: SET_USER_AVATAR_URL,
+    type: 'SET_USER_AVATAR_URL',
     payload: { url: url }
     payload: { url: url }
   })
   })
 })
 })