Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'DropzoneAreaBase' is not exported from 'material-ui-dropzone' #177

Closed
Kaliyani opened this issue May 29, 2020 · 9 comments
Closed

'DropzoneAreaBase' is not exported from 'material-ui-dropzone' #177

Kaliyani opened this issue May 29, 2020 · 9 comments
Labels
Milestone

Comments

@Kaliyani
Copy link

Kaliyani commented May 29, 2020

Bug Report

Describe the bug

Getting error like 'DropzoneAreaBase' not exported

Steps to reproduce

Installed material-ui-dropzone version 3.0.0
Please find my code below
``
import React, { useState } from "react";
import { DropzoneAreaBase } from "material-ui-dropzone";
import { Description, AttachFile } from "@material-ui/icons";
import WordImage from "assets/word.png";
import ExcelImage from "assets/excel.png";

export default function UploadPage() {
const [fileObjects, setFileObjects] = useState([]);
const handlePreviewIcon = (fileObject, classes) => {
const { type } = fileObject.file;
const iconProps = {
className: classes.image,
};

switch (type) {
  case "application/msword":
  case "application/vnd.openxmlformats-officedocument.wordprocessingml.document":
    return <Description icon={<img src={WordImage} />} {...iconProps} />;
  case "application/vnd.ms-excel":
  case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
    return <Description icon={<img src={ExcelImage} />} {...iconProps} />;
  default:
    return <AttachFile {...iconProps} />;
}

};
return (
<DropzoneAreaBase
fileObjects={fileObjects}
onAdd={(newFileObjs) => {
console.log("onAdd", newFileObjs);
setFileObjects([].concat(fileObjects, newFileObjs));
}}
onDelete={(deleteFileObj) => {
console.log("onDelete", deleteFileObj);
}}
getPreviewIcon={handlePreviewIcon}
/>
);
}
``

Expected behavior

Need to get DropzoneAreaBase as exported component from material-ui-dropzone

issue

Versions

  • OS: Windows
  • Browser: NA
  • @material-ui/core version: 4.9.2
  • material-ui-dropzone version: 3.0.0

Additional context

Here i have attached my package.json file for more information.
package

@panz3r
Copy link
Contributor

panz3r commented May 29, 2020

Hi @Kaliyani ,

Thanks for your feedback, DropzoneAreaBase and DropzoneDialogBase components are available with version 3.2.0 which is yet to be published to npm.

for now if you need to upgrade you can install the module directly from GitHub

❯ npm i yuvaleros/material-ui-dropzone#4fda0ea

(the same also works with yarn)

Thanks for your feedback and patience.

@Kaliyani
Copy link
Author

Kaliyani commented May 30, 2020

Hi @panz3r,

I have downloaded the package from below GitHub,

npm i yuvaleros/material-ui-dropzone#4fda0ea

Still i am getting the same error. Please find the below screen shot.

image

Also i could see the component name DropzoneAreaBase is missspelled as DrozponeAreaBase.

My package.json file now looks like below,

image

@panz3r
Copy link
Contributor

panz3r commented May 31, 2020

Hi @Kaliyani ,

Thanks again for your feedback, I checked and fixed an issue with the Typescript typings (the Drozpone typo).

You can try out with the latest version, installable by running

❯ npm i yuvaleros/material-ui-dropzone#34290a7

The component is correctly exported as DropzoneAreaBase (the actual issue was with the TS typings).

@Alarees
Copy link

Alarees commented Jun 2, 2020

hi, i have the same problem, the above npm code not working, it results error :

undefined ls-remote -h -t ssh://[email protected]/yuvaleros/material-ui-dropzone.git

@panz3r

@panz3r
Copy link
Contributor

panz3r commented Jun 2, 2020

Hi @Alarees ,

Thanks for your feedback, I just made a quick test ( I created a new app using create-react-app and added material-ui-dropzone using yarn add yuvaleros/material-ui-dropzone#34290a7) and can confirm it worked.

The error you posted seems related to an npm or git issue.

@juanigaray
Copy link

Note that for panz3r's workaround to work you must have yarn installed!

@Sxoo
Copy link

Sxoo commented Jun 5, 2020

Hey @panz3r,

Will 3.2.0 be added to npm anytime soon?

@panz3r
Copy link
Contributor

panz3r commented Jun 5, 2020

Hi @Sxoo ,

Actually version 3.2.0 was wrongly published to NPM as version 3.1.0 😅 , unfortunately that version includes wrong TS typings so it's causing some issues (see #172 and #184 ).

I just pushed a fix for that to master and they will be published as version 3.2.1.

@panz3r panz3r added this to the 3.2 milestone Jun 7, 2020
@panz3r
Copy link
Contributor

panz3r commented Jun 14, 2020

Hi,

Version 3.2.1 is now complete but not yet released to npm.

In the meanwhile to install it you can do the following

❯ npm i yuvaleros/material-ui-dropzone#v3.2.1

(the same also works with yarn add)

@panz3r panz3r closed this as completed Jun 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants