Custom icon in tsx component
See original GitHub issueBug 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
Issue Analytics
- State:
- Created 3 years ago
- Reactions:11
- Comments:7
Top Results From Across the Web
Icons as React Components - David Gilbertson - Medium
Icons are just components; Icons are rendered inline as SVG (server-side too); Code weight is tiny; Adding a new icon is adding one...
Read more >menu/custom-icon.tsx at master · react-component ... - GitHub
menu/docs/examples/custom-icon.tsx. Go to file · Go to file T
Read more >chakra-react-select custom icon components (TypeScript)
CodeSandbox is an online editor tailored for web applications.
Read more >How to Use SVG Icons in React with React Icons and Font ...
Luckily with React, we can create a new SVG component pretty easily that allows us to add our custom SVG icons anywhere we...
Read more >Custom icon wrapper component - reactjs - Stack Overflow
The IconComponent component below should do. You can see it live in this codesandbox. // Icon.tsx import React, { ReactNode } from "react"; ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Subv when it will be released??
Please when will it be updated?