question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom icon in tsx component

See original GitHub issue

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 bug

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:11
  • Comments:7

github_iconTop GitHub Comments

11reactions
layan-khater-zzcommented, Oct 25, 2020

@Subv when it will be released??

0reactions
netevolutioncommented, Dec 14, 2021

Please when will it be updated?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found