Skip to content

Commit

Permalink
examples: remove useUppy from React Native example (transloadit#5405)
Browse files Browse the repository at this point in the history
  • Loading branch information
mifi authored Aug 19, 2024
1 parent fd2b8e5 commit b506a72
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions examples/react-native-expo/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import AsyncStorage from '@react-native-async-storage/async-storage'
import Uppy from '@uppy/core'
import Tus from '@uppy/tus'
import FilePicker from '@uppy/react-native'
import useUppy from '@uppy/react/lib/useUppy'
import FileList from './FileList'
import PauseResumeButton from './PauseResumeButton'
import ProgressBar from './ProgressBar'
Expand All @@ -27,15 +26,13 @@ export default function App () {

const setState = useCallback((newState) => _setState((oldState) => ({ ...oldState, ...newState })), [])

const uppy = useUppy(() => {
return new Uppy({ autoProceed: true, debug: true })
const [uppy] = useState(() => new Uppy({ autoProceed: true, debug: true })
.use(Tus, {
endpoint: 'https://tusd.tusdemo.net/files/',
urlStorage: AsyncStorage,
fileReader: getTusFileReader,
chunkSize: 10 * 1024 * 1024, // keep the chunk size small to avoid memory exhaustion
})
})
}));

useEffect(() => {
uppy.on('upload-progress', (file, progress) => {
Expand Down

0 comments on commit b506a72

Please sign in to comment.