Material-UI-Dropzone Typescript Example

Intro

This NPM plugin: https://www.npmjs.com/package/material-ui-dropzone
is very popular, however the examples are in JavaScript. Here’s a typescript equivalent of their posted example:

import React, { useState } from "react";
import { DropzoneAreaBase } from "material-ui-dropzone";
import "./styles.css";
const Home = () => {
const [files, setFiles] = useState([]);
const handleAdd = (newFiles: any) => {
setFiles([...files]);
};

--

--

--

Most of my writing is about software. I enjoy summarizing and analyzing books and self-help videos. I am a full-time software engineer.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Flatiron School Project #4 Rails API backend + Javascript frontend Project

Jest, React and Preact!

6 Useful Node.js Modules Developers Should Know In 2021

Connecting your React app to Redux

How to upload images to AWS S3 using React.JS and Node.JS express server

What happens when you type gcc main.c

Changing parent element of dynamic Angular component

Functional Components vs Class Components in React

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
janac

janac

Most of my writing is about software. I enjoy summarizing and analyzing books and self-help videos. I am a full-time software engineer.

More from Medium

SPAs: from Server to Client and back

Implementing Webpack’s Module federation in a Vue 2 application.

Toggle Tab with Vanilla TypeScript and WAI-ARIA

Make an ESLint plugin for your team