reactjselectronreact-reduxredux-formformsy-material-ui

How to enable file upload on React's Material UI simple input?


I am creating a simple form to upload file using electron-react-boilerplate with redux form & material ui.

The problem is that I do not know how to create input file field because material ui does not support upload file input.

Any ideas on how to achieve this?


Solution

  • The API provides component for this purpose.

    <Button
      variant="contained"
      component="label"
    >
      Upload File
      <input
        type="file"
        hidden
      />
    </Button>