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

Icon with custom svg producede type error in TS #649

Open
fredmaggiowski opened this issue Oct 9, 2024 · 0 comments
Open

Icon with custom svg producede type error in TS #649

fredmaggiowski opened this issue Oct 9, 2024 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers Icon component Icon component and hooks related activities typings

Comments

@fredmaggiowski
Copy link
Member

fredmaggiowski commented Oct 9, 2024

In a TypeScript project, an error is produced when trying to use a custom svg as component.

The feature or bug you are proposing

Type error should not occur

A snippet of code for replicating the issue or showing the proposal usage if applicable

import {Icon from '@mia-platform-internal/console-design-system-react'

import SomeSvg from './some-svg.svg'

const i = <Icon component={SomeSvg} />
                           ^
            Type string is not assignable to IconComponent
immagine

The expected result for your bug

Use a custom svg.

Your environment

node: v20.17.0
os: darwin

@fredmaggiowski fredmaggiowski added bug Something isn't working Icon component Icon component and hooks related activities typings good first issue Good for newcomers labels Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers Icon component Icon component and hooks related activities typings
Projects
None yet
Development

No branches or pull requests

1 participant