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]);
};

--

--

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