DEV Community

Cover image for Build a Modern, Customized File Uploading User Interface in React with Plain CSS

Build a Modern, Customized File Uploading User Interface in React with Plain CSS

jsmanifest on June 15, 2019

Find me on medium. Building a user interface around a file input component is a very handy skill to learn as you can go from a 90s look to a more ...
Collapse
 
waracci profile image
Morris Warachi

I was able to follow through the tutorial despite a few issues here and there. One of the issues occurred after installing the react-md-spinner and classnames packages.
The error encountered was:

Cannot find module babel-preset-react-app/node_modules/@babel/runtime

The solution I found on the Create-React-App Github page under the issues tab was to install Babel-Runtime using the following command:

npm add @babel/runtime

Ps. Please add the command to the tutorial when using spinner and classnames packages in your tutorial.

npm i react-md-spinner classnames --save

It will be easier for beginner level programmers to follow through the tutorial.

Collapse
 
jsmanifest profile image
jsmanifest

The post has been updated, thank you!

Collapse
 
sarthakganguly profile image
Sarthak Ganguly

Novice question - where are the files being uploaded to?

Collapse
 
jsmanifest profile image
jsmanifest

That is a great question! For this tutorial, I used a mock function to "upload" the files. In your own app, you would use your own uri endpoint to upload the files to. If I used a real uri to upload my files to, I'd unnecessarily be using resources from a real server.

A real world scenario of a user interface that this tutorial can represent is this page: pexels.com/upload/

You select an image, the thumbnail gets displayed, and when you're ready you hit the "Publish" button.

This tutorial shares the same goal (submit/upload files to a destination), except it teaches how you would show to the user what is happening in between as it finishes uploading each file so that the user is constantly engaged with your app.

Collapse
 
sarthakganguly profile image
Sarthak Ganguly

Thank you.