Custom icon in tsx component
netevolution opened this issue · 7 comments
Bug Report
Custom icon in tsx component
Describe the bug
In the project we use typescript and framework Material UI.
I'm trying to replace the upload icon with my own icon.
From your example, I will impose an icon from the Material UI:
import {AttachFile} from "@ material-ui / icons";
I will insert it into the DropZoneArea component according to the example:
<DropzoneArea
...
Icon = {AttachFile}
Typescript reports this error in VS Code:
Type 'OverridableComponent<SvgIconTypeMap<{}, "svg">>' is missing the following properties from type 'ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>': type, props, key
@Subv when it will be released??
Hi,
by any chances, the bug has been fixed an released?
Thanks for your help!
I am also wanting this released.
Any update?
As far as I know for solving this problem, you can override the type in your project by creating d.ts
file.
after creating the file write this code:
declare module 'material-ui-dropzone' {
// writing types that you want to override:
// .....
Icon?: React.ComponentType;
// .....
}
Please when will it be updated?