How to link uppy to my react app, on following the doc I cannot find uppy in my node_modules and I cannot use it. Please help me integrating uppy with my react-app.
Sorry for the late reply, but if this is still an issue for you or anyone, I should be able to assist.
Assuming you’re starting out with something like create-react-app
, the first thing you’d need to do is install the packages for Uppy
npm install @uppy/react @uppy/core
Following this, you should set up a component with your uppy instance and a Dashboard
// src/components/Dashboard.jsx
import React from 'react'
import Uppy from '@uppy/core'
import { DashboardModal } from '@uppy/react'
// Adds all the needed css
import '@uppy/core/dist/style.css'
import '@uppy/dashboard/dist/style.css'
export default class Dashboard extends React.Component {
constructor (props) {
super(props)
this.uppy = Uppy()
// load your plugins here
}
componentWillUnmount () {
this.uppy.close()
}
render () {
// pass any options that would be used when initializing the dashboard as props
return <DashboardModal uppy={this.uppy}/>
}
}
Then wherever you need your Dashboard, you can import this component. Most of this code comes from here
I hope this helps. Let me know if you have any further problems or questions
- Andrew